[rhn-users] ulimit modification
Grant Street
grants at al.com.au
Tue Nov 1 06:32:53 UTC 2005
Hello Geoff
> We have an application that we host on Red Hat ES4. This application
> brokers network connections from a host of clients. Recently with some
> increased activity we noted that the application dies because it can't
> make any more connections. When the application is run as root this
> isn't a problem because the startup script specifies:
>
> ulimit -n 16384
>
> However in order to run this app as a non-privileged user, I still need
> to alter the ulimit. I believe I found the solution by adding:
>
> #Increase number of file descriptors.
> fs.file-max=16384
>
> To the end of /etc/sysctl.conf. However testing shows that the app
> still stops accepting connections at about 1000 when run as a
> non-privileged user. One of my suspicions is that it has to do with the
> way the app is started. The app is started out of /etc/init.d, but
> instead of being started as root, then the app dropping privs, it is
> started with the command:
>
> su <username> -c /full/path/to/app
>
> What am I missing to alter the ulimit for the user that I am trying to
> run this app under?
Try adding a line in the /etc/security/limits.conf (as well as the
sysctl.conf entry), this allows you to set the limits on a per user,
group etc. eg
<username> hard nofile 16384
Grant
More information about the rhn-users
mailing list