CentOS - Finding out what page PHP is serving

  • jammer2552
  • Graduate
  • Graduate
  • User avatar
  • Posts: 139

Post 3+ Months Ago

Hello again Ozzu, let's see if I can stump the technological geniuses who reside here.

I run a pretty active website, and it occasionally get's bogged down. By the time I realize it, I have just enough to time SSH in and use htop to find out resource usage/process count.

Most of the time, it's a plethora of mysql processes and apache processes. I would love to track down the offending page. However, the way the site is set up is that a single page (index.php) acts as the controller, accepting GET variables to determine what page to generate. The downside to this is the fact that in htop, all of the processes simply show up as index.php, leaving me with no idea what page is being called and is causing the issue.

I was wondering if there was a way for me to discover which pages are being generated in htop, by means of GET. I noticed that cpanel spawns processes when logging in saying "cpanel - serving xxx.xxx.xxx.xxx" so I was wondering if I could set my script to take a similar route, or perhaps there is a better solution.

Thank you in advance,
James
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

Won't the apache access_log file give you an idea what page it was? All the GET requests are there. You just have to correlate the times. Then test that page yourself.
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

you could add some stat code to each page and have it record some figures and you could average out where the problem is.

Now first you want to know the loading times and execution of each page then you would want to average the time out on each page. so you would check your records page and sort the longest loading page at the top.

Then chances are that is the page that is giving you trouble.

Then i would suggest a rewrite of the page to give less executions of the serverload. But if you really had to find the info, would just take some stat collecting.

back in the day i used to work on the tbsource source and there was a mod that was similar that helped track down serverload hogging pages.

just a thought

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.