cms icon indicating copy to clipboard operation
cms copied to clipboard

Automatically increase resource limits

Open lw opened this issue 12 years ago • 1 comments

Some system resources may be limited, like the maximum number of open file descriptors. This particular limit could be easily reached by services like RWS that keep many open connections to make long-polling HTTP requests. It's possible to increase this limit up to a certain hard limit by calling ulimit -n <value> before executing RWS. Yet, RWS could change this limit itself, by making

import resource
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard))

Is this code really equivalent to the ulimit call? Does it make sense to execute it at startup?

lw avatar Jan 02 '13 20:01 lw

I do not think this should be handled by CMS itself. Just write a simple service file for systemd, which starts CMS with all limits set properly.

gollux avatar Aug 09 '22 17:08 gollux