New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Weird latency at first http access
Hello,
I own a les vps (Italy) with nothing running and whe I try to access a php page via simple http (nginx) the server responds after 5 seconds. The following requests are instantaneous. It seems like there's a connection delay for the server to come up.
I noticed that in those 5 seconds the php page is not processed...it tried both via direct ipv4 and with cloudflare ipv6 tunnel. This doesn't happen for ssh access. Could it be nginx does some kind of "pre-check" after X hours of no access? It is weird since it never happened with other providers.
Comments
are you running php5-fpm with ondemand settings for the pool?
if so, then it takes some time(don't know how long, but not too long) for a child to become active and process the server's request.
See some explanation: http://www.webhostingtalk.com/showthread.php?t=1138195&p=8024658#post8024658 and http://stackoverflow.com/questions/29111271/php5-fpm-static-dynamic-or-on-demand
No I'm not using on demand config.
Are you using a caching mechanism? Could be some slow loading components to the page, which are cached afterwards.
My guess .... Dns.
Try doing a page test with tools.pingdom.com and showing us the results .
Browser caching...?
NSA
5 seconds sounds like a DNS timeout. Check if all the resolvers configured on the VPS are alive.
I did a test with pingdom but it has no useful information, it actually took 21seconds to open the link today from there, the following ones a < 1sec. Where should I check DNS resolvers?
Anyway no caching on, it's almost a vanilla nginx configuration. What I don't is why it doesn't happen with ssh access.
/etc/resolv.conf
Just have the two Google's DNSs.
And on your computer? Problem might be your dns servers (and/or records), not the configuration of the server.
Is it the same for all the sites you browse or just for one particular site?
It happens with all computers (even pingdom test resulted in the same behaviour)
Then its possibly about the nameservers of the domain in question. Probably at least one of domain nameservers not serving.
Yes, it takes a few ms for the NSA to pull your profile AND verify
It also happens with direct IP, does it matter?
Then post a screenshot of pingdom so we can see ! We can't help you if you don't post the information.
I will later but doesn't the page just show the seconds to load the page with no other info?
See those lovely colors? They mean things! They are a great tool to actually see what is causing the page to load so slowly. It is kinda why I asked so long ago for you to post it. That way we could actually make an informed conclusion on what is taking so long for the page to load.
OK I didn't see when hovering the time you get also those info...
Right now it's doing it so I don't know maybe because I restarted nginx days ago. Not sure what's happening.
Sorry I meant "it's not doing it" of course