tags:

views:

268

answers:

1

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

+3  A: 

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.

aeby
I figured there was some config like this - not sure why it so hard to find (e.g. it isn't in setrlimit man page). Thanks!
Jonathan Swartz