I ran some tests against a website I am building using tools.pingdom.com. I notice that the first request made to connect to the site took almost 5 seconds to return. I have another site hosted by different provider, and the first request took less than one second to fulfill. I ran the tests several times using different connection and the result is consistent. I am wondering what would have caused the slowness on the first request. I don't think it had trouble resolving the domain name as ping was very fast.
It could be latency, as suggested above. It could be that one server is slower than the other. Our, given these are different sites, it could just be that one site needs to do a lot more processor work before it can return the page. To compare hosts like this, you really need too work with identical sites on both.
Perhaps different methods of caching are being used by the two providers resulting in different response times. Are you using identical websites for the purpose of this test (eg. fresh Wordpress install on each provider's server).
I re-ran the test 5 times against each of the two sites, and the pingdom tool picks a random server from one of new york, dallas or amsterdam for execution. The first site consistently requires more than 5 second wait time before responding to the first request, while the second site needs 1 sec at most. I have a friend who has a site hosted on the first company, and his site's response time of his site is <1 sec. Therefore I am suspecting something is wrong with the way my site is setup on the hosting company. Any ideas how I could find out? I already tried contacting the hosting company but they are of no help.
If you could provide an example of the page, then we can give more details, if it's slow or not. 5 seconds for a full page load can surely be fast.. but if it's the initial request, then it can be very slow.
http://www.webpagetest.org/ offers a lot more locations and details. Maybe try that first and choose a location as close as possible to the datacenter your website is hosted at. If the results are the same, contact your provider or switch to another one if he isn't able to resolve this (implying that you're on shared hosting or a managed VPS).
█ JavaPipe LLC: Global Tomcat Hosting & DDoS Mitigation Solutions
█ In business since 2001 | Contact us: salesrequest[at]javapipe.com
█ Remote Protection | Dedicated Servers | Virtual Servers | Unmetered VPS | Tomcat Hosting
If later requests are faster then the initial requests, two factors are likely at play:
One site is heavier in terms of PHP (or whatever the language is), meaning that the server takes longer processing that code
One server is faster than the other at doing the above, which can be down to innumerable factors ranging from overcrowded hardware to inferior configuration to quite simply superior hardware
Most web servers nowadays make use of things like PHP-APC to cache PHP requests, meaning that after the initial request it doesn't have to do the same processing again for a while. This will equalise results even if one server is significantly more powerful than the other.
I don't think geography is a factor in your results, based on your observation that later requests are the same speed.