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


Groups > comp.lang.php > #17473 > unrolled thread

Understand if host is slow and in where

Started byalbert <alstopspam@stopaspam.com>
First post2017-06-10 16:02 +0200
Last post2017-06-10 20:03 +0200
Articles 3 — 3 participants

Back to article view | Back to comp.lang.php


Contents

  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

#17473 — Understand if host is slow and in where

Fromalbert <alstopspam@stopaspam.com>
Date2017-06-10 16:02 +0200
SubjectUnderstand if host is slow and in where
Message-ID<ohgu5k$c7b$1@gioia.aioe.org>
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


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?


What is the cause of the delay?


for test
I used a simple html page
in tis case the delay isn't 1 sec but 0,4 sec

seems that php managed by the server is slow 0,6 sec respect at the php 
managed by the localhost's pc? is so?


but the 0,4 sec?


which test I can to do for Understand the delays?





[toc] | [next] | [standalone]


#17474

FromLuuk <luuk@invalid.lan>
Date2017-06-10 16:45 +0200
Message-ID<593c0626$0$842$e4fe514c@news.xs4all.nl>
In reply to#17473
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
> 
> 
> 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?
> 
> 
> What is the cause of the delay?
> 
> 
> for test
> I used a simple html page
> in tis case the delay isn't 1 sec but 0,4 sec
> 
> seems that php managed by the server is slow 0,6 sec respect at the php 
> managed by the localhost's pc? is so?
> 
> 
> but the 0,4 sec?
> 
> 
> 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

[toc] | [prev] | [next] | [standalone]


#17475

From"J.O. Aho" <user@example.net>
Date2017-06-10 20:03 +0200
Message-ID<eq2qjsF6e17U1@mid.individual.net>
In reply to#17474
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web