[NTLUG:Discuss] Apache problem?

David Camm dcamm at advwebsys.com
Wed Nov 20 12:30:01 CST 2002


the scripts are not the problem. you need to check two things:

1. /proc/sys/fs/file-max which should have a rather high value (like
8192 or so). if it doesn't you can change this temporarily by: echo 8192
>/proc/sys/fs/file-max and permanently by including the echo in rc.local

2. apache most likely needs to be re-compiled with a higher hard server
limit, which is hard-coded to 256 in the binary. see httpd.h in the
apache include directory. here's what we did:

#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 1024
#endif
#endif

to allow up to 1024 concurrent server processes.

david camm
advanced web systems

Jim Wildman wrote:
> 
> As a further exercise, take a good look at the script(s) you are
> running.  Are they written in OS resource efficient way?  ie, do
> they only open files/processes when they are needed and then close
> those handles right away?  I'm no Perl monk, but I've taken scripts
> and reduced them from 16-20 system calls to 2.  That makes a difference
> when the script is being called every 30 seconds!
> 
> ------------------------------------------------------------------------
> Jim Wildman, CISSP                                      jim at rossberry.com
> http://www.rossberry.com
> 
> On Wed, 20 Nov 2002, Douglas King wrote:
> 
> > Here's the scenario.  I have a Red Hat 7.3 box, running Apache 1.3.23....running MANY name virtual hosts
> > (1,000+ total sites).  The kernel has been re-compiled.
> >
> > Here's the problem:
> >
> > When attempting to run cgi scripts on some of the web sites....it doesn't run, but gives a:
> >
> > Too many open files: couldn't spawn child process: /var/www/cgi-bin/tx-xx/ema_list.cgi
> >
> > This error message is found in /var/log/error log
> >
> > We messed with Apache last night trying different setups in that conf file....
> >
> > Timeout  300
> >
> > KeepAlive  Off
> >
> > MaxKeepAliveRequests  100
> >
> > KeepAliveTimeout  15
> >
> > MinSpareServers  25
> > MaxSpareServers 50
> >
> > StartServers  100
> >
> > MaxClients  200
> >
> > MaxRequestsPerchild  10
> >
> >
> > I am running about 2 - 3 dozen independant log files.....one error log file.
> >
> > What's my problem?
> >
> >
> >
> >
> 
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list