increase ulimit for # of file descriptors

我的梦境 提交于 2019-12-31 00:59:10

问题


As normaluser:

$ ulimit -n 4096
-bash: ulimit: open files: cannot modify limit: Operation not permitted

As root it works as desired - but then it won't affect normaluser.

How to get out of this catch 22? I'll need this to be persistent.


回答1:


You may want to look at /etc/security/limits.conf




回答2:


To change file descriptor limit as normal user before running any applicaiton.

I use this small utility fdlimit which will increase file descriptor limit using "setrlimit()" system call before executing any program.

I use it like this

$ sudo ./fdlimit <fdlimit> <program_to_run>


来源:https://stackoverflow.com/questions/11017402/increase-ulimit-for-of-file-descriptors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!