Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.