[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Raising maximum file descriptors



On Sunday 06 August 2006 14:11, Andreas Fester wrote:
> Paul Johnson wrote:
> > I'm stuck really badly on this...  even though my
> > /etc/security/limits.conf has the necessary lines that should allow me to
> > change my ulimit, I still can't do it.
> >
> > baloo@ursine:~$ ulimit -n 4096
> > bash: ulimit: open files: cannot modify limit: Operation not permitted
> > baloo@ursine:~$ ulimit -Sn
> > 1024
> > baloo@ursine:~$ ulimit -Hn
> > 1024
> >
> > What am I doing wrong or failing to check?
> See also, for example
>
> http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/node7.html

Edit /etc/security/limits.conf and add the lines: 
*       soft    nofile  1024
*       hard    nofile  65535

Edit /etc/pam.d/login, adding the line: 
session required /lib/security/pam_limits.so

The system file descriptor limit is set in /proc/sys/fs/file-max. The 
following command will increase the limit to 65535: 
echo 65535 > /proc/sys/fs/file-max

You should then be able to increase the file descriptor limits using: 
ulimit -n unlimited

 The above command will set the limits to the hard limit specified 
in /etc/security/limits.conf.

baloo@ursine:~$ ulimit -n unlimited
bash: ulimit: open files: cannot modify limit: Operation not permitted

It does succeed as root, but what I need more descriptors for need not use 
root...

-- 
Paul Johnson
Email and IM (XMPP & Google Talk): baloo@ursine.ca
Jabber: Because it's time to move forward  http://ursine.ca/Ursine:Jabber

Attachment: pgp8BfjB4XLre.pgp
Description: PGP signature


Reply to: