ERP5/zopewsgi: Add option to increase soft limit of open file descriptors
Hello everyone,
this is a follow-up patch from our forum discussion regarding the limit of open file descriptors.
Initially I misunderstood previous work as slapos.package!140 (merged) to be related to the problem I want to solve, but it's actually different: I'm interested in finding a more simple/programmable way to increase the open file descriptor limit of zope processes, as this is particularly necessary in Wendelin based projects, where we're easily crossing the 1024 border. I suggest to simply add a new parameter to the zopewsgi bin that increases the soft limit to a user provided number.
@vpelletier wrote in the forum (replying to @jerome statement that we don't use select in erp5):
Hopefully this statement is true. But also, ERP5's Zope process is importing so much 3rd-party code (which may further call into C libraries, etc) that I have a low confidence in its accuracy.
I can't say anything profound about this, apart from that in the WWM project we always significantly increased the nolimit without any recognized issues. The newest ERP5 version we used so far is 79fa584e, so I don't know if newer versions introduced a problem.
Please also find more details in the commit message below.
Best, Levin
/cc @klaus
The default soft limit of open file descriptors is usually set to 1024 in order to avoid breaking old software which still uses select. In many projects we may need a higher limit: particularly in Wendelin based projects we easily reach this limit. Before this patch it was therefore necessary to either patch ERP5 in the project specific SR or to manually increase the limit of the zope processes (or the parent supervisor) with a tool like plimit [1]. With this patch it becomes possible to specify the desired soft limit as a command line argument to the zopewsgi binary, which simplifies setting the soft limit for any Wendelin project.