Re: [PHP] Scripts taking too much time



On Mon, September 18, 2006 11:54 am, Chris wrote:
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.

Are you running any of the cache programs such as APC/Turck/Zend Cache?

Or the Zend Optimizer?

Try disabling those and re-running the tests, just to be certain it's
not the cache acting up.

I'd also suggest trying some other tools to monitor the activities --
just in principle, to be certain that the monitors themselves are
accurate. I have no particular package in mind -- Just that two heads
are better than one when trying to view what's happening at that level
of detail.

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

Just in general, I'd suggest that 30-40 includes per request is a bit
excessive...

Can none of them be combined?

I *believe* the big "hit" for an include is in the disk seek, not
reading and parsing some bits of PHP code.

This is not likely to be at all related to your current issue -- just
a general observation.

--
Like Music?
http://l-i-e.com/artists.htm
.



Relevant Pages

  • Re: [PATCH] speed up SATA
    ... The kicker when handling any request larger than the on-disk cache ... insufficient buffer for the entire host request), ...
    (Linux-Kernel)
  • Re: IIS 6.0 Not Caching Images
    ... There is a known bug where if a 204/304 is fulfilled from the kernel ... regardless if it is fulfilled from the kernel response cache or not. ... request is cached in kernel mode (in addition to using WFetch to make the ... server or not -- you need perfmon to determine. ...
    (microsoft.public.inetserver.iis)
  • Re: IIS 6.0 Not Caching Images
    ... which the client would reuse on subsequent requests to the ... IIS is not sending the ETag header on the request correctly. ... > coming out of the kernel mode cache or not. ... There is a known bug where if a 204/304 is fulfilled from the kernel ...
    (microsoft.public.inetserver.iis)
  • Re: Timer question
    ... it seems that the reason you use RemoveCallBack now is just need to ... I think you can consider use a separate background thread to do the ... Cache, you can event not specify a expiration timeout. ... | The request triggered method you recommend is what I am currently doing. ...
    (microsoft.public.dotnet.general)
  • Re: ASP, caching data in the Application object
    ... > Now this works fine as long as there aren't a lot of simultaneous request for this page when the cache has expired. ... > If however the cache has expired and several request are made to the same page, each instance of this page will be taking the task upon him to recreate the cached data, which is unnecessary. ... This code loads the latest data into the currently unused buffer and ...
    (microsoft.public.inetserver.asp.general)