V
V
Valery Ryaboshapko2014-08-07 22:05:45
PHP
Valery Ryaboshapko, 2014-08-07 22:05:45

How to find out what the response time from the server consists of?

I am writing a script to backup a site on one unpopular engine. To implement a backup through a button in the control panel, I use a series of AJAX requests, each of which puts hundreds of files into the archive. Thus, the problem of timeout in the work of the script and the response from the server is solved, plus the user has a visualization that does not allow him to be nervous.
The problem is that the response time for the next request is from 5 to 15 seconds, while the script itself is executed in less than a second. I measured the script's running time using two calls to microtime (true) - in the first line of the "entry point" to the engine and immediately after the output of my plugin.
The question is, where does the rest of the time go? How to check it?
Apache 2.2.22, PHP 5.5.4, run via mod_php.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Ryaboshapko, 2014-08-08
@valerium

I asked it myself, I answered it myself ... I messed up :-)
The bottom line is that I put microtime () in the wrong place. For archiving, I used ZipArchive, and measured the time it takes for ZipArchive::addFile(), but did not take into account ZipArchive::close(). But it is at the moment of closing that the file is written to.

A
Antony Ryabov, 2014-08-07
@tonymadbrain

On the client side - firebug or fiddler see.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question