I have a question re transfer rates on Amazons EC2. Basically I am evaluating a move to the Amazon stack of services, however wanted to benchmark it against our current setup first. My setup is pretty simple, I just have one large EC2 instance running accessing one small RDS instance, with both being located in the EU-West Zones. On the EC2 instance I am running the stock apache config file whereas on my current server I am running a modified apache config file. This means that I am expecting fewer concurrent connections however I was expecting the transfer rate to be similar.
The benchmark tests I am running are nothing are bog standard ab (apache benchmark) tests
ab -n 100 -c 10 http://www.example.com/
The setup on EC2 resulted in the following:
ab -n 100 -c 10 http://www.example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.website.com (be patient).....done
Server Software: Apache/2.2.14
Server Hostname: www.example.com
Server Port: 80
Document Path: /
Document Length: 99051 bytes
Concurrency Level: 10
Time taken for tests: 17.872 seconds
Complete requests: 100
Failed requests: 97
(Connect: 0, Receive: 0, Length: 97, Exceptions: 0)
Write errors: 0
Total transferred: 9940632 bytes
HTML transferred: 9898332 bytes
Requests per second: 5.60 [#/sec] (mean)
Time per request: 1787.165 [ms] (mean)
Time per request: 178.716 [ms] (mean, across all concurrent requests)
Transfer rate: 543.19 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 22 29 11.9 26 87
Processing: 717 1740 689.6 1530 3744
Waiting: 586 1475 619.3 1302 3112
Total: 739 1769 688.7 1561 3770
Percentage of the requests served within a certain time (ms)
50% 1561
66% 1713
75% 1892
80% 1975
90% 3300
95% 3674
98% 3674
99% 3770
100% 3770 (longest request)
whereas my server responded with this:
ab -n 100 -c 10 http://www.example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.example.com (be patient).....done
Server Software: Apache
Server Hostname: www.example.com
Server Port: 80
Document Path: /
Document Length: 116922 bytes
Concurrency Level: 10
Time taken for tests: 9.024 seconds
Complete requests: 100
Failed requests: 95
(Connect: 0, Receive: 0, Length: 95, Exceptions: 0)
Write errors: 0
Total transferred: 11731386 bytes
HTML transferred: 11693186 bytes
Requests per second: 11.08 [#/sec] (mean)
Time per request: 902.427 [ms] (mean)
Time per request: 90.243 [ms] (mean, across all concurrent requests)
Transfer rate: 1269.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 15 21 9.5 17 52
Processing: 311 840 663.6 482 2987
Waiting: 188 362 416.1 216 1607
Total: 338 861 661.8 501 3003
Percentage of the requests served within a certain time (ms)
50% 501
66% 909
75% 1063
80% 1292
90% 2130
95% 2366
98% 2912
99% 3003
100% 3003 (longest request)
Is anyone else experiencing these low transfer rates? Are they normal for EC2 instances? May I be doing something wrong?
If you need any more information on this please let me know.
Thanks for all your help.
Is example.com hosting PHP/Rails?
Honestly I went through the same benchmark process when comparing EC2 vs Rackspace's (RS) Cloud based offerings with very similar results (stock wordpress index.php page used in AB)
My conclusion and research showed that EC2's bottleneck - even on high CPU instances was the CPU or "Compute Units" when it came to serving PHP. The simplest wordpress index.php on the default theme was returning ~40x less Req/second than RS on identical OS/stack. Honestly the $10/month cloudserver from RS outperformed the $160 or whatever it was EC2 instance - this is likely because RS is on newer infrastructure and every cloudserver comes with a direct physical access to a modern CPU. My guess is EC2 is simply running older hardware and/or there are more moving parts/layers between your code and processing it.
EC2 is about as stable and well thought out as any cloud offering, perhaps moreso than all of them, but it's not a place to go for highload performance unless you can throw a ton of money at it, at which point you'd probably get more out of a dedicated offering or even colo.
Reddit (in top 100 sites in alexa) and other hightraffic sites host on EC2 - so don't get me wrong, it can be done. Caching and load balancing up front with a cluster of high cpu web nodes should do the trick. All im saying is - if you are a looking for decent performance from a single machine for the purpose of serving php, you may be better suited elsewhere...
If you aren't getting more than 2 req/sec or 216,000 visits/day perhaps this whole thing is a non-issue and you can/should benefit from the stability and features of amazon's stack.