cancel
Showing results for 
Search instead for 
Did you mean: 

'ulimit -n' for normal user

 
Steven McCoy
Valued Contributor

'ulimit -n' for normal user

Hey guys,

We've got some developers here that would like to increase the default 1024 file handle limit per process. I can change root's setting, but not the user's:

# ulimit -n 2048
# ulimit -n
2048

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

I had read somewhere that this just isn't possible with normal users, but wanted to run it by you guys before giving that answer to the developers.
4 REPLIES
Steven E. Protter
Exalted Contributor

Re: 'ulimit -n' for normal user

Shalom,

My results:
open files: cannot modify limit: Operation not permitted

It might be possible however to use sudo to give the developers this power.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: 'ulimit -n' for normal user

I played around a bit more.

Its not going to have a significant impact to set the number higher for all users in /etc/profile

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven McCoy
Valued Contributor

Re: 'ulimit -n' for normal user

Thanks for your replies, Steven. I apologize I did not post sooner, was sucked into a +1 hour meeting. Anyway, this is what I ended up doing:

Edit "/etc/security/limits.conf", and add the below lines:

tomcat2 hard nofile 8192
tomcat2 soft nofile 8192

Where "tomcat2" is the user that needs the increase, hard/soft are the limit types to set (you'll want both), nofile means the number of files that can be open at a time, and '8192' is the actual number/limit.

NOTE: You must start a new session as tomcat2 to make this effective, it will not take effect on existing sessions.

Hopefully this helps someone along the way. Seems this problem is common with Java devs.
Steven McCoy
Valued Contributor

Re: 'ulimit -n' for normal user

See above post