okey, i had a hunch that my sollution was to easy to be the right one...
How about timing a ping sent to the server (e.g. like pinging a person on irc), could that be possible, or is there flaws in that plan to???
Warren Vail wrote:
I could be wrong, but I don't think it measures all the time you want.
The fsockopen will measure the time it takes to resolve the dns entry, and
open the socket, but it does not measure the time it takes to get the
request to the server (you could send the request thru your socket and if
you are doing blocked transfers, the question becomes, when does the server
acknowledge receipt of your request, immediately or by sending the finished
page? Don't know enough about web servers and http to be sure).
The other factor you are trying to measure is how much delay is there in the server between the receipt of the request and the beginning of processing. If PHP is being run as a CGI on this server, then the server will need to load PHP, which will then load your script, which will then begin executing your script (any one of these events could be defined as beginning processing), and almost impossible to measure. An idle server will begin your process without any delay, but if you are concerned about this response time, I'm guessing the server is not idle.
You have a tough problem, wish I could offer more help,
Warren Vail
-----Original Message-----
From: Tobias Grønlund [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 04, 2004 5:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: webserver response-time, how?
i meant time from i send the requestpacket to the server begins processing the request, but i think that i have found a sollution now. I've used microtime() to time how long it took to make a fsockopen() on the webpage... schouldnt the output then be showing the result of my problem??
Warren Vail wrote:
I support several PHPNuke sites and the page preparation time is measured by taking a microtime stamp at the very beginning of the script and another just before echoing the last couple of lines at the bottom of the page and producing something like the following on the bottom of the page;
Page Generation: 0.376 Seconds
This does not measure all the elements of delay, however, which can be broken down into the following;
1. Time it takes for browser to get the request packet to the web server. 2. Time it take the web server to begin processing the request. 3. Time it takes to load PHP and for PHP to load your script (CGI or MOD?)
4. Time it takes for your script to complete execution is measured above.
5. Time it takes for the cached output from your script to be delivered back to the browser. 6. Time it takes to perform 1-5 above for any imbedded images, etc requests. 7. Time it takes for the browser to render the completed page.
It's not clear from your question, which of these you wanted to measure. If you were to develop another application running on your local machine, then you could use things like socket connections to simulate a browser, invoke the page and measure the total span of time. In this case I would recommend using CURL, or Pears HTTP_REQUEST instead of dealing with the intricacies of building the request, etc.
Hope this helps,
Warren Vail
-----Original Message----- From: Tobias Grønlund [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 04, 2004 4:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: webserver response-time, how?
M. Sokolewicz wrote:
Tobias grønlund wrote:
Im trying to find a way of getting the responsetime from a remote webserver before it actually starts sending some output for your browser to read. Any ideas??
try timing the fsockopen() or (whatever you use) call. :) That'll give you a reasonable estimate.
- Tul
how do i do that??
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php