A BOSH release which mimics the function of ulimit
Upload release to director.
Set properties in manifest:
properties:
nofile:
soft: 16384
hard: 16384
Only works for the ulimit property "open files".
Creates /etc/security/limits.d/62-ulimit.conf
.
Dynamically adjust monit's "Max open files".
This runs as a pre-start script.
Fixes: Accept error: accept tcp [::]:80: accept4: too many open files
.
Defaults to 16384/16384 soft/hard limit for all users.
This was tested on Ubuntu and CentOS stemcells.
This release has 2 components:
-
A pre-start executable (
pivotal_prlimit
, a small C program which uses prlimit(2)) which modifies the ulimit of the runningmonit
process.monit
, as it forks sub-processes (i.e. as it starts jobs), will pass along the updated ulimits (max number of open files). This makes sure the ulimit is set on initial deployment. -
A template which creates
/etc/security/limits.d/62-ulimit.conf
which sets the ulimit on reboot (pre-start scripts are not run on reboot).