Welcome to WebmasterWorld Guest from 23.22.206.103

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Best way to find a php script using up server load?

     
8:43 pm on Jun 16, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:June 24, 2005
posts: 446
votes: 0


Just went live with a big site today and it's really bogged down the server. When I go into linux and type top I see a lot of php processes with assigned to the new websites user and very high cpu usage (10+ on for these php threads).

Problem is that linux top is very cryptic...is there a way to isolate from a server standpoint which php files are causing the problems?
4:18 pm on June 18, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 3, 2003
posts:1633
votes: 0


Hi,

If you're seeing actual php processes in the top output that would indicate that PHP is running in CGI mode (as opposed to as an Apache module) so instead of "top" try the command "ps ux" (make your terminal window nice and wide!) as this may point to the actual PHP script that has been invoked.

If that is revealing (I'm afraid I'm not in a position to test that immediately) then as a next step run "top" again and note the process IDs of the php instances that appear to be bogging things down, and then pipe the output of "ps ux" through a grep to narrow things down, e.g. if it looks like process ID 2345 is a culprit then use

ps ux | grep 2345
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members