What is the difference between EC2 and Linode? Based on my findings, I realize there are a million things that can go wrong. Where do I start?
I have been timing requests to my blog landing page (via Apache Benchmark). It has about 22 sql queries and a fair amount of html. I setup the exact same site on two server.
Web1 - Hosted at Linode (512 Size VPS).
Web2 - Hosted at Amazon (micro VPS).
Then I tested making 100 concurrent connections to both. I ran the test first to warm up the database then really ran it.
Web1 - 33 Requests per second.
Web2 - 5 Requests per second.
Then I installed page caching. This is where it stores the complete html return in a file. So instead of going through the PHP controller and making database connections it just returns the static html file.
Web1 - 32 Requests per second.
Web2 - 88 Requests per second.
You will notice file caching does not really do much on Web1. Seems the database / PHP returns as fast and just opening one file and returning it. You will notice on Web2 it got crazy fast compared to the first request.
I have taken these measurements a bunch of times throughout the day. It is not an issue of a one time thing.
Here is what I know.
I am really interested in finding out what makes Web2 so slow when there is no caching and pretty fast when there is caching and Web1 is the same both ways.
What are your ideas? CPU, IO?
How can one track down the bottleneck?
I do not see any crazy loads (with "w"). Not 100% what is valuable in "iostat" (as to what I should be looking at).
One possible factor is that EC2 EBS volumes tend to be quite slow compared with standard HDDs (and even more when compared with SSDs).
See this SO Q&A. And this criticism (that is linked to from the SO link).
This isn't probably the complete reason for the slowness, but it's at least a partial reason if the Linode option is using real HDDs.