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);