I have a long running process that is eventually going to hit the max open file limit. I know how to change that after it fails, but is there a way to change that for the running process, from the command line?
Linux – Set max file limit on a running process
limitslinuxprocessresource-managementulimit
Related Topic
- Linux – How to configure linux file descriptor limit with fs.file-max and ulimit
- Linux – DF Not Showing Correct Free Space After File Removal
- Linux – VFS: file-max limit 1231582 reached
- Linux Process Management – Keeping a Linux Process Running After Logout
- Linux – /etc/security/limits.conf soft nproc limit appears to be ignored
- Ubuntu – How to set max file descriptors for a container
- Linux – How to change default of max open files per process
Best Answer
As documented here, the
prlimit
command, introduced with util-linux 2.21 allows you to read and change the limits of running processes.This is a followup to the writable
/proc/<pid>/limits
, which was not integrated in mainline kernel. This solution should work.If you don't have
prlimit(1)
yet, you can find the code to a minimalistic version in theprlimit(2)
manpage.