[GRLUG] Increasing number of open files

Roberto Villarreal rvillarreal at mktec.com
Mon Dec 11 15:40:02 EST 2006


On Friday 08 December 2006 17:24, Greg Folkert wrote:
> On Fri, 2006-12-08 at 13:57 -0500, Roberto Villarreal wrote:
> > I'm running an program and getting a "Too many open files" error.  This
> > is one topic that google has no shortage of hits for, but none of them
> > that don't require another kernel compile have worked.  In a nutshell,
> > I've:
> >
> > - read Documentation/sysctl/fs.txt (not much help)
> > - set/altered various 'files' in /proc/sys/fs/
> > - tried various things with 'ulimit'
> > - rebooted and turned off most unneeded services/programs
> > - verified that the program runs correctly on a second computer
> >
> > In the meantime, I'm going to start a compile, but I was curious if
> > anyone had encountered this, and if so, has a solution that I didn't
> > include above.
> >
> > Running Debian and kernel 2.6.18
>
> Just to let you know, I modified /etc/security/limits.conf by adding the
> following:
>
> 	*               hard    nofile          100000
>
> Here is the result:
>
> greg at prince:~$ ulimit -a
> core file size          (blocks, -c) 0
> data seg size           (kbytes, -d) unlimited
> max nice                        (-e) 0
> file size               (blocks, -f) unlimited
> pending signals                 (-i) unlimited
> max locked memory       (kbytes, -l) unlimited
> max memory size         (kbytes, -m) unlimited
> open files                      (-n) 100000
> pipe size            (512 bytes, -p) 8
> POSIX message queues     (bytes, -q) unlimited
> max rt priority                 (-r) 0
> stack size              (kbytes, -s) 8192
> cpu time               (seconds, -t) unlimited
> max user processes              (-u) unlimited
> virtual memory          (kbytes, -v) unlimited
> file locks                      (-x) unlimited
>
> Notice that Open Files changed.

Greg --

Got it working!  Before your post, I had actually done what you had suggested.  
I had an entry in the limits.conf file and had rebooted at various times 
after that, with no effect.  After tearing my hair out, I reanalyzed what you 
had different than me.  You can file this away for future reference, but 
there is a limit as to the value you can put for that field :-).  You'd think 
that it would either give an error at login or automatically set it to the 
actual ceiling value, but it doesn't.  Once I changed it to the same value 
you had (one million), the change worked fine.

Also, that limitation must hold true for the /proc manuplation too.  I had 
already tried your suggestion, but for my arbitrarily large 
number.  'cat'-ing the file-nr file showed my new value, but must require 
a 'sane' number for the change to actually do anything.

Thanks again for your help!
Roberto


More information about the grlug mailing list