Raising hard limit on RLIMIT_NOFILE system-wide on Linux

懵懂的女人 提交于 2019-12-21 06:23:42

问题


We need to raise RLIMIT_NOFILE when running memcached, as we're hitting the default hard limit (1024). However, raising a hard limit requires root, and for various reasons we don't want to have to run memcached or its containing shell as root. Right now we happily run it as a non-root user.

Is there a way to raise the hard limit for RLIMIT_NOFILE system-wide, so that we can continue to run memcached as non-root and simply raise the soft limit?

This is RedHat Linux with 2.6 kernel.

Thanks!

Jon


回答1:


You can set the limits in /etc/security/limits.conf with the syntax:

<domain> <type> <item> <value>

The <domain> can be a user (i.e. memcache) or a group.



来源:https://stackoverflow.com/questions/2694004/raising-hard-limit-on-rlimit-nofile-system-wide-on-linux

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