Re: [PHP] Scripts taking too much time



On 9/18/06, Chris <listschris@xxxxxxxxxxxxxxx> wrote:

Hi,

I'm hoping somebody can give me advice on how I can go about debugging a
problem I've been having. The bottom of this email has some of the
details of my system.

There is an intermittent slowness throughout my site. At seemingly
random points in random scripts at random times it just seems to wait.

A few of these have been as long as 600 seconds, just sitting there,
apparently doing nothing. I've tried tracking down the problem using
microtime(), that jsut showed me how (mostly) random it was. The least
complex area in which I was able to isolate a problem was a 15 line
chunk of HTML, with some <?=MY_CONSTANT?> in them.

I'd appreciate any advice or suggestions, thanks!
Chris

==[Details]===================================================
I've compiled both Apache and PHP, neither are RPMs:

Apache 2.0.55 (Compiled with mod_prefork)
PHP 5.1.2 (module)
CentOS 4.2 (Essentially a repackaged Red Hat Enterprise 4)

I'm averaging about 2 requests a second, spiking occasionally to 10 per
second, but not very often. At no time is anything on the server "maxed
out" CPU sometimes gets to 20%, memory never hits swap (at least not
that I can see), disk activity is minimal (my database is not on the
same server).

My site has a decent amount of includes, it's probably doing 30-40
includes per request, with an occasional require or two.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


If you have a dev site you might consider using Xdebug's profiling features
(http://xdebug.org/docs-profiling.php) to see every function call, include,
etc to figure out where the bottleneck is happening. This might point you
in the right direction in finding out why something is being slow.

One cool thing is that you can set Xdebug to automatically generate
cachegrind files for each request since your problem seems to be
intermittent.


Relevant Pages

  • Re: [PHP] Scripts taking too much time
    ... I'm hoping somebody can give me advice on how I can go about ... I've compiled both Apache and PHP, ... If you have a dev site you might consider using Xdebug's profiling features to see every function call, include, etc to figure out where the bottleneck is happening. ... One cool thing is that you can set Xdebug to automatically generate cachegrind files for each request since your problem seems to be intermittent. ...
    (php.general)
  • Re: Well
    ... Chris. ... I have no problem with that dispensation and you ... angry with me over dispensing advice which is to be respected. ... You see that bit above where you decry insults and such? ...
    (misc.writing)
  • RE: Cannot set value via event
    ... Advice to Posters. ... Check your post for replies or request for more information. ...
    (microsoft.public.access.formscoding)
  • RE: Cannot set value via event
    ... Advice to Posters. ... Check your post for replies or request for more information. ...
    (microsoft.public.access.formscoding)
  • Re: Switching a friend to Ubuntu
    ... Isn't that like you recommending to others to use or not use a distro? ... Why because of your own emotional disturbance? ... If you are going to tar and feather folks for a few words and request ... You should take your own advice. ...
    (Ubuntu)