Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently installed Zend Server 5 to take advantage of doing some code traces while improving performance in some areas of my app.

I've been looking through some of my code traces where there are long request times.

Sometimes I see long REQUEST times with only ~25% of the actual time going into the actual code execution (i.e. from index.php on)

I was wondering if anyone was familiar with this sort of thing and would appreciate any help.

share|improve this question

I'm not familiar with zend-server nor how it calculates the metrics you mention, but would like to think I know a bit about PHP, apache and web stuff in general.

Typically PHP execution time is only a small part of the total time taken to service a request - there is a significant delay in getting the request across the network and recognised by the webserver (this is probably not reported/included in metrics though). I would expect the clock to start at this point. The webserver then passes the request to PHP, which has to load and parse the relevant code files. This can be relatively time consuming - and hence the benefit in using an opcode cache. Then once the code actually starts executing, if it has to read in any data from files/database/other this will be a significant overhead (and PHP will sleep while waiting for a response in most cases). Even once the PHP script completes that's not the end of the story - the webserver process has to hang around until the client has acknowledged all of the data - the clock may still be running.

There are all sorts of things you can do to improve performance on the network, in the PHP code, on the database, on the filesystem and on the browser - far, far too much to answer here. Certainly I don't think its unusual that PHP would only be executing code for 25% of the lifetie of a request (indeed, if anything I would suspect that is rather high - implying that either your PHP code is very inefficient or that everything else is working very well).



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.