How to increase open files limit for all processes

limitresourcesrhelulimit

I can use ulimit but I think that only affects my shell session. I want the limit increased for all processes. This is on Red Hat.

Best Answer

Justin's answer tells you how to raise the number of open files available total to the whole system. But I think you're asking how to raise the per-user limit, globally. The answer to that is to add the following lines to /etc/security/limits.conf:

*               soft    nofile            2048
*               hard    nofile            2048

(Where the * means all users.)

There's some summary documentation in that file itself and in man limits.conf. This is implemented via the pam_limits.so module which is called for various services configured in /etc/pam.d/.

And, I have to admit, I have no idea where that 1024 default comes from. And believe me, I looked. I even tried without the pam_limits module configured, and it's still there. It must be hard-coded in somewhere, but I'm not exactly sure where.