Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17475

Re: Understand if host is slow and in where

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Understand if host is slow and in where
Date 2017-06-10 20:03 +0200
Message-ID <eq2qjsF6e17U1@mid.individual.net> (permalink)
References <ohgu5k$c7b$1@gioia.aioe.org> <593c0626$0$842$e4fe514c@news.xs4all.nl>

Show all headers | View raw


On 06/10/17 16:45, Luuk wrote:
> On 10-06-17 16:02, albert wrote:
>> in my pc in localhost the page (a filter result) is loaded in 1,3 sec
>>
>> the same application but on server I can see the result after 2,3 sec
>> so from the host's server to my home it takes a second longer

The difference may be in the load on the server, specially if you are on
a webhotel, then there are loads of pages hosted on the same server and
the response time will get bed if it's over deployed.


>> ping from my pc is  80ms
>> that is 0,080  seconds
>> time for receive data (0,08 sec) not affect the total time of the
>> delay (1 sec), is so?

While the ping time is 80ms, it will not cause any other difference than
adding on 80ms to the request and reply

>> What is the cause of the delay?

Most commonly reasons:
- Over crowded webhotel servers
- Badly tuned webserver
- Badly written php pages



>> which test I can to do for Understand the delays?
>>
> Add some coe like to to your page:
> $time1 = microtime(true);
> usleep(2500000);
> echo "Current needed time: " . round(microtime(true) - $time1,3) . "
> seconds\n";
> usleep(2400000);
> echo "Current needed time: " . round(microtime(true) - $time1,3) . "
> seconds\n";
> 
> of course you should replace the lines with usleeop() with you r actual
> code
> 
> my example lines retrun:
> Current needed time: 2.5 seconds
> Current needed time: 4.9 seconds

I wouldn't recommend it to be echo:d out on the page, log it in a file
instead (if you have access to the whole machine, syslog() is a good
tool), this way nothing will be showed to the users of the site and the
data can be useful if someone tries to attack the page, that way they
can get a cleaner understanding of what may happen on the page.

-- 

 //Aho

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Understand if host is slow and in where albert <alstopspam@stopaspam.com> - 2017-06-10 16:02 +0200
  Re: Understand if host is slow and in where Luuk <luuk@invalid.lan> - 2017-06-10 16:45 +0200
    Re: Understand if host is slow and in where "J.O. Aho" <user@example.net> - 2017-06-10 20:03 +0200

csiph-web