Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
PHP/Symfony and the RDS is MySQL –  luxerama Oct 25 '11 at 18:02
    
Another hit on the req/sec might be RDS but I do think you are experiencing the same bottleneck. Checkout top or htop in a seperate shell while you run your benchmark and see if the CPU caps –  iainlbc Oct 25 '11 at 18:05
    
I'd be very surprised if all EC2 hardware wasn't quad core as well. –  ceejayoz Oct 25 '11 at 19:27
    
Perhaps, but that's not my point. I'm pretty sure it depends on the instance type/region which underlying CPU/architecure you are given. Bottom line is, in my experience, EC2 sucks at crunching at PHP and is likely on old hardware. –  iainlbc Oct 25 '11 at 19:32
    
@iainlbc I'm not sure if I can confirm that. I have been testing a little more, and both the CPU barely breaks into sweat (peaks at around 60% on the large instance, and at about 35% on the xlarge instance) if I run 100+ concurrent requests. –  luxerama Oct 25 '11 at 22:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.