Skip to content

Instantly share code, notes, and snippets.

@A
Last active December 26, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A/7172787 to your computer and use it in GitHub Desktop.
Save A/7172787 to your computer and use it in GitHub Desktop.
Почему стоит писать NODE_ENV=production
# create app
npm i -g express
express test
cd test
npm i
# test w/o NODE_ENV
node app.js > /dev/null &
pid=$!
ab -n 1000 -c 100 -k -q http://127.0.0.1:3000/ | grep "Requests per" | cut -d ' ' -f 7
kill $pid
# I get 201.47 RPM
# test w/ NODE_ENV=production
NODE_ENV=production node app.js > /dev/null &
pid=$!
ab -n 1000 -c 100 -k -q http://127.0.0.1:3000/ | grep "Requests per" | cut -d ' ' -f 7
kill $pid
# I get 1680.13 RPM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment