summaryrefslogtreecommitdiff
path: root/couchjs/c_src/util.h
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2011-12-03 14:12:17 -0500
committerRobert Newson <robert.newson@cloudant.com>2012-11-14 17:26:43 +0000
commitb9f0271cf63efed0af5c3c4aec5a31c928da1079 (patch)
treef0fbbdc1802cf2df28f297c7241a655028156fa6 /couchjs/c_src/util.h
parent90c656fd3097272d1e574da3f5944d60b476e418 (diff)
Allow processes to idle before exiting
When system load exceeds the ability of os_process_soft_limit to keep up with demand we enter a fork-use-kill (FUK) cycle. The constant spawning and destruction os these processes thrashes system resources and causes general instability. This patch changes the behavior from killing each process as its returned to letting it idle for a configurable amount of time (default five minutes) which allows it to be reused by other clients. This way we can avoid adding unnecessary load when demand for couchjs processes exceeds os_process_soft_limit. As a happy benefit this should also allow os_process_soft_limit to be set much lower since the number of processes will now more closely follow actual demand (instead of provisioning for the worst case scenario). Conflicts: apps/couch/src/couch_os_process.erl apps/couch/src/couch_proc_manager.erl Conflicts: apps/couch/src/couch_os_process.erl
Diffstat (limited to 'couchjs/c_src/util.h')
0 files changed, 0 insertions, 0 deletions