Once or twice a day one of my Apache's on Debian 5.0.3 (upgraded to latest packages) runs up to 100% CPU (a few processes) and remains that way until it's restarted. Strace shows a lot of these;

select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})
select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})
select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})
select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})
select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})
select(1043, [1042], [], NULL, {1, 0})  = 1 (in [1042], left {1, 0})

rapidly following eachother.

What could this be? It's a normal LAMP install with memcached.

The problem started (we think) when we started to output S3 directly instead of getting the whole file first, so in pseudecode;

First we had;

print file_get_contents($s3url);

now we have;

$f = fopen($s3url, "r"); 
while($s=fread($f, 4096)) echo $s;
fclose($f);
link|improve this question

50% accept rate
feedback

1 Answer

Did you check maximal number of open files for Apache server user ?

su -s /bin/sh - www-data ulimit -a

then check your system wide openfiles limit in /proc.

link|improve this answer
There are no too many open file errors and the number of open files allowed is 65535; I'm sure those aren't used, but I tried upping it anyway with the same results as the problem described. – CharlesS Dec 7 '09 at 2:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.