Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 1998 12:37:34 -0700 (PDT)
From:      Jim Van Baalen <vansax@mail.websidestory.com>
To:        Brian Tiemann <btman@ugcs.caltech.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: PLEASE! Re: Problems with process limits
Message-ID:  <Pine.BSI.3.96.980729123304.4174J-100000@mail.websidestory.com>
In-Reply-To: <Pine.BSF.4.02.9807291014030.28438-100000@lionking.org>

next in thread | previous in thread | raw e-mail | index | archive | help
There are #proc and #openfile limits that are assumed from the shell in
which you start your webserver. This can be particularly frustrating if
you have a habit of starting your webserver by hand. You can set ulimits 
in the shell from which you start your webserver. Try something like

ulimit -u 2048
ulimit -n 1024

These numbers may not be appropriate for your site, but I have had to
increase ulimits in this fashion on some of my busier webservers so that
cgi weren't always failing.

Jim

On Wed, 29 Jul 1998, Brian Tiemann wrote:

> 
> 	Could someone please reply? I've tried everything I can think of,
> including setting kern.somaxconn=512 via sysctl, and setting Apache's hard
> server limit higher. Still no luck.
> 
> 	If *anyone* has any suggestions, I'd love to hear them...
> thanks...
> 
> [Wed Jul 29 10:12:16 1998] [error] (35)Resource temporarily unavailable:
> couldn't spawn child process: /usr/www/cgi-bin/counter-nl-ord
> 
> Brian
> 
> 
> ---------- Forwarded message ----------
> Date: Mon, 27 Jul 1998 11:14:08 -0700 (PDT)
> From: Brian Tiemann <btman@ugcs.caltech.edu>
> To: freebsd-questions@FreeBSD.ORG
> Subject: Re: Problems with process limits
> 
> 
> 
> 	I'm hoping my message only got lost in the shuffle, and not that
> nobody has an answer to my predicament. :P I'll repeat the message...
> here's hoping some kind soul has dealt with this before and knows how to
> fix it.
> 
> 	As clarification, I'm running a custom kernel with (I thought)
> adequate settings:
> 
> machine         "i386"
> cpu             "I386_CPU"
> cpu             "I486_CPU"
> cpu             "I586_CPU"
> cpu             "I686_CPU"
> ident           LIONKING
> maxusers        256
> 
> options         MATH_EMULATE            #Support for x87 emulation
> options         INET                    #InterNETworking
> options         FFS                     #Berkeley Fast Filesystem
> options         NFS                     #Network Filesystem
> options         MSDOSFS                 #MSDOS Filesystem
> options         "CD9660"                #ISO 9660 Filesystem
> options         PROCFS                  #Process filesystem
> options         "COMPAT_43"             #Compatible with BSD 4.3 [KEEP THIS!]
> options         SCSI_DELAY=15           #Be pessimistic about Joe SCSI device
> options         BOUNCE_BUFFERS          #include support for DMA bounce buffers
> options         UCONSOLE                #Allow users to grab the console
> options         FAILSAFE                #Be conservative
> options         USERCONFIG              #boot -c editor
> options         VISUAL_USERCONFIG       #visual boot -c editor
> #options         MAXMEM=130048
> #options         SOMAXCONN=256           # max pending connects
> options         NMBCLUSTERS=4096        # mbuf clusters at 4096
> options         CHILD_MAX=512           # maximum number of child processes
> options         OPEN_MAX=768            # maximum fds (breaks RPC svcs)
> 
> 
> 	Nonetheless, it starts being unable to spawn new httpd process
> (running as "www") once it's got about, oh, 128 of them going. If anyone
> sees any gaping errors in my "www" class (below), could you please let me
> know?
> 
> 	Could this be something about the RAM ceiling that FreeBSD places
> on certain applications (at least, according to LINT)? To wit:
> 
> # Certain applications can grow to be larger than the 128M limit
> # that FreeBSD initially imposes.  Below are some options to
> # allow that limit to grow to 256MB, and can be increased further
> # with changing the parameters.  MAXDSIZ is the maximum that the
> # limit can be set to, and the DFLDSIZ is the default value for
> # the limit.  You might want to set the default lower than the
> # max, and explicitly set the maximum with a shell command for processes
> # that regularly exceed the limit like INND.
> #
> options         "MAXDSIZ=(256*1024*1024)"
> options         "DFLDSIZ=(256*1024*1024)"
> 
> 	So does that mean it will aggregate all the httpd processes
> together and not allow them to use more than 128MB total? Is this new to 
> 2.2.6-ish? If that's the case, I guess I'd have to add those options...
> does this look familiar to anyone?
> 
> 	Thanks...
> 
> 
> On Fri, 24 Jul 1998, Brian Tiemann wrote:
> 
> > 
> > 	Hi... I'm having a problem with a high-load webserver that I hope
> > someone can help me with.
> > 
> > 	I'm running 2.2.6... the server is sustaining a pretty regular 30
> > httpd processes at any one time. However, when it spikes up to around 128
> > or so (total system processes over 160), I start getting "Couldn't spawn
> > child process" messages in my error_log.
> > 
> > 	httpd runs as "www"; the www user is in a class called "www".
> > Here's the entry in login.conf:
> > 
> > www:\   
> >         :path=/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin:\
> >         :cputime=infinity:\
> >         :filesize=128M:\  
> >         :datasize-cur=64M:\
> >         :stacksize-cur=32M:\
> >         :coredumpsize-cur=0:\
> >         :maxmemorysize-cur=128M:\
> >         :memorylocked=32M:\ 
> >         :maxproc=512:\  
> >         :maxproc-cur=256:\
> >         :openfiles=512:\
> >         :tc=default:
> > 
> > 
> > 	I managed to solve this using login.conf in 2.2.2, but I can't
> > seem to get it to behave here. Is there something I'm missing? 
> > 
> > 	Thanks!
> > 
> > Brian
> > 
> > 
> > 
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> > 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.96.980729123304.4174J-100000>