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

Re: file descriptors??



On 7 Jan 1998, Kai Henningsen wrote:

> cas@taz.net.au (Craig Sanders)  wrote on 07.01.98 in <[🔎] Pine.LNX.3.96.980107103756.5460C-100000@siva.taz.net.au>:
> 
> > On 7 Jan 1998, Miquel van Smoorenburg wrote:
> >
> > > In article <[🔎] Pine.LNX.3.96.980107084321.5460B-100000@siva.taz.net.au>,
> > > Craig Sanders <cas@taz.net.au> wrote:
> > > >
> > > >On Tue, 6 Jan 1998, Elie Rosenblum wrote:
> > > >
> > > >> And thus spake Craig Sanders, on Wed, Jan 07, 1998 at 01:52:06AM +1100:
> 
> > i've tried applying the "gt256 fd patch" but that causes some NFS
> > problems (i use nfs to mount my debian mirror for upgrades) which would
> > probably go away if netstd and netbase were recompiled with the new fd
> > limit.  I feel that it's a bit unreasonable to expect debian users to
> > recompile the entire system if they happen to be building a server (e.g.
> > squid proxy or apache web server) that needs more than 256 fds.  Given
> > that debian makes an excellent web server or proxy or internet gateway
> > machine out of the box it's not an uncommon thing to want to do...
> 
> Well, with libc6, they don't have to, unles they need more than 1024 files  
> per process. Kernel and maybe libc, but not the rest.

so if i need more than 1024 file descriptors (say 4096 fds for squid
and 1024 for everything else == 5120 total) for squid then all i have
to recompile is squid and libc6 and the kernel??? as long as i have the
soft ulimit set in /etc/initscript as mvs suggested then everything else
will work without recompilation?

btw, Miquel said:

    > What I do is something different. I put this in /etc/initscript:
    > 
    > # Set # of fd's to 256 for all processes.
    > ulimit -S -n 256
    > 
    > That sets the soft limit for all processes to 256 fds. It can be
    > raised by an individual process if needed. My /etc/init.d/squid script
    > contains:
    > 
    > MAXFD=`ulimit -H -n`
    > if [ "$MAXFD" -gt 1024 ]
    > then
    > MAXFD=1024
    > fi
    > ulimit -n $MAXFD

i'd change that to MAXFD=4096 of course.



> See this excerpt from /usr/include/gnu/types.h:
> 
> ----
> 
> /* One element in the file descriptor mask array.  */
> typedef unsigned long int __fd_mask;
> 
> /* Number of descriptors that can fit in an `fd_set'.  */
> #define __FD_SETSIZE	1024

so, change this to 5120, then recompile libc6 and and the kernel and
squid...


> > you got any good ideas on what to do about the fd limits? is my
> > assumption that increasing the per process limit will require
> > re-compiling just about every package (e.g. squid, apache, netstd,
> > netbase, libc6, ..... etc) correct or have i misunderstood something
> > fundamental?
> 
> That depends on how far you want to increase it.

3 or 4 thousand fds for squid should be enough, plus 1000 for everything
else running on the system....so round it off to 5120. any more than
that and the machine probably wouldn't be able to cope with the load
anyway.

craig

--
craig sanders


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: