Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jun 1998 18:12:54 -0500
From:      MP <mlistbsd@icorp.net>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Apache/ssl: couldn't spawn child process
Message-ID:  <3.0.1.32.19980608181254.006e0d14@icorp.net>

next in thread | raw e-mail | index | archive | help

I recently began testing Apache 1.26/SSL under load and started seeing this
in the ssl error log files (of course, after my telephone rang <g>)

[Mon Jun  8 16:41:55 1998] access to /cgi-bin/myscript failed for
168-64-223.ipt.aol.
com, reason: couldn't spawn child process
fork: Resource temporarily unavailable   

I have "maxusers=256" in my kernel configuration (2.2.6).

I was running into a problem with Apache/ssl - it seems as if the server
cannot fork additional processes - so I assume this is an OS problem and
not an Apache problem.  Here are my relevant settings in Apache's config:

Timeout 300
MinSpareServers 4
MaxSpareServers 12
StartServers    2
MaxClients      200
#MaxRequestsPerChild     30
#MaxRequestsPerChild     0 - default

I was playing around with various settings - I opened up two browser
windows and tried to initiate simultaneous SSL connections and depending
upon my config, one would usually fail and I would not necessarily see
adequate processes listed in my ps list.  I think I've hacked it to be less
problemmatic by simply increasing the number of max & min spare servers but
this is no solution - as it will likely crash when that small limit is tapped.

I have not run into this same problem with Apache 1.26 (non-ssl)

My top typically looks like this:

last pid: 29881;  load averages:  0.03,  0.08,  0.08
18:05:22
66 processes:  7 running, 59 sleeping
CPU states:  0.3% user,  0.0% nice,  0.7% system,  0.7% interrupt, 98.3% idle
Mem: 76M Active, 4744K Inact, 22M Wired, 19M Cache, 8348K Buf, 3272K Free
Swap: 266M Total, 3720K Used, 262M Free, 1% Inuse   

This starts my regular Apache:

#!/bin/csh
set PATH=/bin:/usr/bin:/sbin:/usr/sbin
umask 0002
cd /www/apache
./httpd -d /www/apache/ -f conf/httpd.conf

This starts Apache/SSL:

#!/bin/bash
umask 0002
ulimit
cd /www/apache
./m.httpsd.126 -d /www/apache/ -f ssl_conf/httpd.conf

I HAD apache using csh and a similar config, but have been experimenting
with the 'ulimit' command an an alternate shell (bash) to start the SSL
server to see if this helps.  I suspect the operating environment of the
web server is the culprit.  I've seen discussions relating to changing
/etc/login.conf - but I don't know exactly which settings to tweak or if
this matters.

I've made some changes - but don't know if I've addressed the problem - I
have a funny feeling it will resurface when a certain level of activity hits.

My questions are:

1.  What is the recommended shell/commands/structure to launch
Apache/Apache-ssl?
2.  How can I avoid running into "couldn't spawn child process" error?  I
don't think it's a kernel issue so what are my options?

Thanks!


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?3.0.1.32.19980608181254.006e0d14>