Increase Open Files Limit in Ubuntu

Increase per-user Limit

You can define per-user open file limit on a Debian based Linux system. To set per-user limit, edit /etc/security/limits.conf file in a text editor.

sudo vim /etc/security/limits.conf

Add the following values in file:

*    soft     nproc          65535
*    hard     nproc          65535
*    soft     nofile         65535
*    hard     nofile         65535
username     soft     nproc          200000
username     hard     nproc          200000
username     soft     nofile         200000
username     hard     nofile         200000

Here we specifying separate limits which are 200000 for the user “username” and 65535 will be applied for the rest of the users. You can change these values per your requirements.

After that enable the pam_limits as followings:

sudo vim /etc/pam.d/common-session

Add the following line:

session required pam_limits.so
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容