Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#98 apache spins with select(0, NULL... under heavy load

open
nobody
None
5
2004-05-18
2004-05-17
No

environment:

linux 2.4.23 SMP, two processors, i386.
apache 1.3.26
php 4.3.6
mmcache 2.4.6

symptomps:

after there are about 120 apache processes spawned
the server quickly bumps up to the MAX_CLIENTS limit.
strace shows lots (over 1000) continous
select(0, NULL, NULL, NULL, [0, 100]) calls
and occasionaly the usal stuff betwen them, when a request
finally gets served.

vmstat shows 30 000 to over 140 000 context switches per
second and machine becomes rather unresponsive and
definitely unusable.

setting MaxRequestsPerChild to 1 in httpd.conf helps a lot
load comes back to normal, vmstat reportings are sane,
but this workaround is a bit too harsh for the backend
database, which then goes crazy forking.

I've increased that magic value of 100 to 10000 in
mmcache.c and x86_spinlocks.h. It is easier on CPU, but
I would like to see more elegant solution.

Discussion

    • summary: apache spinns with select(0, NULL... under heavy load --> apache spins with select(0, NULL... under heavy load