increase ulimit for # of file descriptors

2019-02-23 11:44发布

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.

2条回答
唯我独甜
2楼-- · 2019-02-23 12:12

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>
查看更多
小情绪 Triste *
3楼-- · 2019-02-23 12:15

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

查看更多
登录 后发表回答