Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have apache2 web server installed with php in fastcgi

Action application/x-httpd-php "/cgi-wrapper/fastcgi-wrapper"
<Location /cgi-wrapper/fastcgi-wrapper>
    Options +ExecCGI
    SetHandler fcgid-script
<Location /cgi-wrapper/php-ssi-wrapper>
    Options +ExecCGI
    SetOutputFilter Includes
SuexecUserGroup u4686 u4686
ScriptAlias /cgi-wrapper/ /var/www/xxx/

and a cgi wrapper script

. /usr/bin/php-cgi

and some kind of script is eating our memory and mysql cpu at 100%.

php-cgi does not have logging of executable name scripts. How can i directly find the name of bad .php script ?

share|improve this question
How do you know it's one script and not just loads of requests to the web server? Can you post what diagnosis and investigation you've done so far. Also, how much memory your server has, output from free, CPU profile of the server, other installed software, what the website is (custom, wordpress, etc.). Basically - without more info the answer is 'investigate your performance issue'. – EightBitTony May 4 '12 at 8:50
@EightBitTony there was a breach in security from ftp side. some php scripts were changed and there is no way to detect what exactly files affected. there are more than 10 sites on hosting account so it is not the easy way to search for difference. – dima.h May 5 '12 at 5:28
Okay, if someone's breached the server, you should trash it and recover from known good backups. Hunting down stuff on a compromised server is like chasing your tail - futile. – EightBitTony May 5 '12 at 22:54

I think I would start by logging some information in your wrapper script (such as PID, environment variables etc.) and then try to correlate this data to output from other tools such as top.

share|improve this answer

Your Answer


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.