Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance Difference Between Amazon EC2 and Linode

Just interested in what is the difference between EC2 and Linode based on my findings. I realize there are a million things that can go wrong. Just wondering where to 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.

  • Both systems are the same. As I configured them both with the same deploy scripts.
  • Web2 (Amazon) is most likely running on a SAN (the filesystem).
  • Web1 (Linode) is most likely running from a local hard drive (the filesystem).
  • Not sure what CPU's are behind it. I would assume they are different CPUs. I can not imagine there is much difference in CPU.

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?

What would you do to 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).


Thanks.

like image 990
spicer Avatar asked Aug 31 '12 00:08

spicer


1 Answers

So I figured it out.

Lame. But if you have a micro instance at Amazon they will limit your CPU. So when I was trying to connect multiple times with concurrent connections they were limiting my CPU.

like image 109
spicer Avatar answered Oct 26 '22 19:10

spicer