Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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);
share|improve this question

1 Answer 1

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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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