You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tig <ti...@gmail.com> on 2004/11/25 11:55:31 UTC

[users@httpd] Apache 2.0.52 worker unstable (on FreeBSD) with many requests

My partner started a small web site, but it took off and now does
860gig of traffic per month, 99.99% of it being 2kb request (I think
its about 15,000,000 request per day). I'm not very experienced with
this level of traffic at all :]

I read (or miss-read) that the Apache worker MPM would be a better
than prefork for this many request. With prefork, the number of
running httpd process was anywhere from 500 to 900 (with SeverLimit
900 set). With worker this is much smaller as expected, however the
server either locks up, has high CPU usage, or becomes generally
unstable. The load averages do seem to be better with worker, but it
does spike higher.

The issue may be related to cronolog, which has now been switched off,
however some logging would still be nice to have. More than happy to
go back to perfork, but worker does seem like the correct mod to run.

I did notice a recent thread called 'Apache 2.0.51 - Mutex Lock
Problem', but I'm not 100% sure if this is the same issue.

My questions are, have I done the right thing in switching over to
worker or should I go back to prefork?

Has anyone else seen Apache (or is it cronolog) this unstable, or does
it sound like I have a configuration error somewhere?

Is there a trick to getting Apache worker stable with cronolog or
should it just work the same as prefork?

The server is running FreeBSD 4.10 and Apache 2.0.52_3 from the FreeBSD ports

A few bits of info from httpd.conf and log files:

httpd.conf:
<IfModule worker.c>
ServerLimit       20
StartServers        10
MaxClients         900
MinSpareThreads     20
MaxSpareThreads    900
ThreadsPerChild         45
MaxRequestsPerChild  10000
</IfModule>

/var/log/messages is full of these:
Nov 25 15:00:05 ernie /kernel: pid 6766 (httpd), uid 0: exited on
signal 11 (core dumped)
Nov 25 15:00:05 ernie /kernel: pid 6778 (httpd), uid 0: exited on signal 11
Nov 25 15:00:05 ernie /kernel: pid 6779 (httpd), uid 0: exited on signal 11
Nov 25 15:00:05 ernie /kernel: pid 6781 (httpd), uid 0: exited on signal 11
Nov 25 15:00:05 ernie /kernel: pid 6780 (httpd), uid 0: exited on signal 11

/var/log/httpd-error.log was full of this (cronolog is now switched off):
piped log program '/usr/local/sbin/cronolog -S
/var/log/httpd-l-day.log -p 1days /var/log/httpd-l-day.log.%y%m%d'
failed unexpectedly
piped log program '/usr/local/sbin/cronolog -S /var/log/httpd-l-b2.log
-p 1days /var/log/httpd-l-b2.log.%y%m%d' failed unexpectedly
piped log program '/usr/local/sbin/cronolog -S /var/log/httpd-l-b3.log
-p 1days /var/log/httpd-l-b3.log.%y%m%d' failed unexpectedly
piped log program '/usr/local/sbin/cronolog -S
/var/log/httpd-l-TTC.log -p 1days /var/log/httpd-l-TTC.log.%y%m%d'
failed unexpectedly

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.0.52 worker unstable (on FreeBSD) with many requests

Posted by Joshua Slive <js...@gmail.com>.
On Thu, 25 Nov 2004 21:55:31 +1100, Tig <ti...@gmail.com> wrote:
> My partner started a small web site, but it took off and now does
> 860gig of traffic per month, 99.99% of it being 2kb request (I think
> its about 15,000,000 request per day). I'm not very experienced with
> this level of traffic at all :]
> 
> I read (or miss-read) that the Apache worker MPM would be a better
> than prefork for this many request. With prefork, the number of
> running httpd process was anywhere from 500 to 900 (with SeverLimit
> 900 set). With worker this is much smaller as expected, however the
> server either locks up, has high CPU usage, or becomes generally
> unstable. The load averages do seem to be better with worker, but it
> does spike higher.
> 
> The issue may be related to cronolog, which has now been switched off,
> however some logging would still be nice to have. More than happy to
> go back to perfork, but worker does seem like the correct mod to run.
> 
> I did notice a recent thread called 'Apache 2.0.51 - Mutex Lock
> Problem', but I'm not 100% sure if this is the same issue.
> 
> My questions are, have I done the right thing in switching over to
> worker or should I go back to prefork?

If you are memory-restricted, then yes, you should be able to get more
performance from worker than from prefork.  But, as you have
discovered, using a threaded server can sometimes be more touchy.

> 
> Has anyone else seen Apache (or is it cronolog) this unstable, or does
> it sound like I have a configuration error somewhere?

I don't use cronolog, so I have no idea of that.  You can always do
manual log rotation.

> The server is running FreeBSD 4.10 and Apache 2.0.52_3 from the FreeBSD ports

Oops.  Running worker under freebsd 4 is not recommended.  There are
some serious threading problems in that version of freebsd.  There are
some reports that freebsd 5 is more thread-capable.

So I would go back to prefork if you stick with freebsd 4.  Then make
sure you have everything tuned correctly.  In particular, given your
load characteristics, you should consider turning down
KeepAliveTimeout and you should carefully read

http://httpd.apache.org/docs-2.0/misc/perf-tuning.html

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org