Red Hat Bugzilla – Bug 1010461
nodejs supervisor poll interval is too short
Last modified: 2016-11-07 22:47:14 EST
Description of problem:
The default poll interval in versions of node.js supervisor prior to 0.5.3 is known to be too short and cause performance issues. nodejs010 SCL contains 0.5.2, and nodejs 0.6 has an even older version. There is a "-p" option to change the interval. "-p 1000" (or higher) is recommended.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a node.js app on Openshift with lots of js files in the repo.
2. Start the app
3. Watch supervisor eat CPU
Unacceptable CPU usage
Reasonably low overhead
strace showed over 1000 futex calls per second in an app with a couple thousand files.
Commit pushed to master at https://github.com/openshift/origin-server
Bug 1010461 - Increase supervisor poll_interval
* Increase default supervisor poll_interval to reduce resource usage
Verified on devenv_3833,
To compare, do the same test on devenv-stage_478,
1. Create nodejs-0.10 app
2. SSH login to the app
3. Copy the server.js file to <random>.js about 5000 times under app-repo
4. Restart the gear
5. Use top to check the cpu usage of the supervisor process
On stage ami, it will use up to 99% cpu, and keep in about 60% for a while and then down to 30%.
On devenv_3833, it will use up to 40% cpu, and will go down in a short time with about 5%-10% usage.
Move bug to verified.