Bug 1010461

Summary: nodejs supervisor poll interval is too short
Product: OpenShift Online Reporter: Andy Grimm <agrimm>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, jgoulding, jhonce, nduong, ricky.hussmann, trevor
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 13:30:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andy Grimm 2013-09-20 20:04:20 UTC
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):

openshift-origin-cartridge-nodejs-1.15.7-1.el6oso.noarch

How reproducible:

Always

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

Actual results:

Unacceptable CPU usage

Expected results:

Reasonably low overhead

Additional info:

strace showed over 1000 futex calls per second in an app with a couple thousand files.

Upstream issue:

https://github.com/isaacs/node-supervisor/issues/71

Comment 1 openshift-github-bot 2013-09-25 06:20:14 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/038acedd8ca9c1c4b93fd45ad5f61767aa552079
Bug 1010461 - Increase supervisor poll_interval

* Increase default supervisor poll_interval to reduce resource usage

Comment 2 Meng Bo 2013-09-26 12:35:15 UTC
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.