homepage Welcome to WebmasterWorld Guest from 54.166.122.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

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

5+ Year Member



 
Msg#: 4327070 posted 8:43 pm on Jun 16, 2011 (gmt 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?

 

dmorison

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4327070 posted 4:18 pm on Jun 18, 2011 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved