Issue #19296 - Cleanup old unused code/files and consolidate #224

merged 5 commits into from Apr 4, 2013


None yet
3 participants

bendiy commented Mar 28, 2013

This pull request will change node-datasource to only use XM.SimpleModel.
We can now cleanup the old XT code which this pull request does.

Once this has been merged, you will need to make some changes to your server.

  1. Review changes to sample_config.js file and update your local config.js file to match. Several setting hard coded into main.js have been moved here:

  2. You may need to remove all active sessions from your database because the session secret is now stored in xtuple/node-datasource/lib/private/salt.txt

    DELETE FROM xt.sessionstore;

  3. All npm package installs have been consolidated to xtuple/node_modules. You need to delete your old node_modues directories:

    cd xtuple/node-datasource
    rm -rf node_modules
    cd xtuple/node-datasource/xt
    rm -rf node_modules
    cd xtuple/lib/backbone-x
    rm -rf node_modules

  4. Then install all npm packages which appears to require sudo now:

    cd xtuple
    sudo npm install

The salt.txt file is currently under revision control. Should it be removed?

I found the cause of file permissions changing from 664 to 775. If you are using SAMBA to access source code, you need to make this change to your /etc/samba/smb.conf file.

Then be sure to restart SAMBA:

sudo service smbd restart
sudo service nmbd restart

All file permissions have been cleaned up in this pull request.

I've move the pg pool size to the config file and changed it from 12 to 15. npm pg package was also upgraded to 0.14.1 which addresses some issues with pgpool and improves memory usage:


You will see a warning when running the installer. It is from these issues and AFAIK not in place yet, but will be in v1.0.0 of the pg package:


parsing and returning floats from PostgreSQL server is deprecated
JavaScript has a hard time with floats and there is precision loss which can cause
unexpected, hard to trace, potentially bad bugs in your program
for more information see the following:
in node-postgres v1.0.0 all floats & decimals will be returned as strings

I've split the pg.connect and pg.client.query code into a child process. This runs all Postgres queries in their own process and frees up the main.js node process to do more work. The pgworker.js process can consume about 20% CPU usage on it's own CPU, letting main.js be 20% faster.

My benchmarks show ~60% performance increase on Apache Bench and ~30% performance increase using autobench httperf from the #19296 code when using a child process pgWorker.
Autobench httperf requests/sec:
pgPoolSize = 3

Apache Bench Response Time
pgPoolSize = 3

@shackbarth shackbarth merged commit 33722fa into xtuple:master Apr 4, 2013


davecramer commented Apr 22, 2013

I'm confused, the pg pool appears to default to 1 now not 13, or 15 ?


bendiy commented Apr 22, 2013

The default of 15 is in the sample config. If that it not set, it defaults to one here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment