"Max open files" for working process
Is it possible to increase "Max open files" parameter for working process ? I mean this parameter:
cat /proc/<pid>/limits | grep files
Thanks for your advices
Another option is to use the prlimit command (from the util-linux package). For example if you want to set the maximum number of open files for a running process to 4096:
prlimit -n4096 -p pid_of_process
As a system administrator: The /etc/security/limits.conf
file controls this on most Linux installations; it allows you to set per-user limits. You'll want a line like myuser - nofile 1000
.
Within a process: The getrlimit and setrlimit calls control most per-process resource allocation limits. RLIMIT_NOFILE
controls the maximum number of file descriptors. You will need appropriate permissions to call it.