2013-08-28

S3とCloudfrontのapache benchによるベンチマーク

条件
S3バケット、apache benchを動作させるEC2インスタンス共に東京リージョン
EC2インスタンスはc1.medium
独自ドメインはR53で管理

1. S3バケットポリシーでアクセス許可をしたtest.txtにS3のURLでアクセス
2. S3バケットポリシーでアクセス許可をしたtest.txtにStatic Website HostingのURLでアクセス
3. S3上のtest.txtにCloudfront経由での配信を設定しCloudfrontのURLでアクセス
4. S3上のtest.txtにCloudfront経由での配信を設定、独自ドメインを割り当て独自ドメインのURLでアクセス

Document Path: /test.txt
Document Length: 10 bytes

結論からいくと平均レスポンスタイムは

良い                                  悪い

パターン3≦パターン4<<超えられない壁(3~4倍の差)<<パターン1≦パターン2

な感じの模様
結果の詳細は以下の通り

1. $ ab -n 10000 -c 10 http://xxx.s3.amazonaws.com/test.txt
1回目
Concurrency Level: 10
Time taken for tests: 33.292 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 3780000 bytes
HTML transferred: 100000 bytes
Requests per second: 300.37 [#/sec] (mean)
Time per request: 33.292 [ms] (mean)
Time per request: 3.329 [ms] (mean, across all concurrent requests)
Transfer rate:  110.88 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 3   12 31.1   5    3017
Processing: 8   21 90.4  22    3024
Waiting: 8   21 90.4  22    3024
Total:        11   33 96.2  38    3044

Percentage of the requests served within a certain time (ms)
  50%   38
  66%   44
  75%   45
  80%   47
  90%   49
  95%   52
  98%   55
  99%   60
 100% 3044 (longest request)
2回目
Concurrency Level: 10
Time taken for tests: 19.364 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 3780000 bytes
HTML transferred: 100000 bytes
Requests per second: 516.41 [#/sec] (mean)
Time per request: 19.364 [ms] (mean)
Time per request: 1.936 [ms] (mean, across all concurrent requests)
Transfer rate:  190.63 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 3    6  3.4   9  40
Processing: 5   13 79.5  12    3012
Waiting: 5   13 79.5  12    3011
Total:  8   19 79.7  21    3021

Percentage of the requests served within a certain time (ms)
  50%   21
  66%   23
  75%   23
  80%   23
  90%   24
  95%   25
  98%   30
  99%   37
 100% 3021 (longest request)

2. $ ab -n 10000 -c 10 xxx.s3-website-ap-northeast-1.amazonaws.com
1回目
Concurrency Level: 10
Time taken for tests: 36.137 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 3560000 bytes
HTML transferred: 100000 bytes
Requests per second: 276.73 [#/sec] (mean)
Time per request: 36.137 [ms] (mean)
Time per request: 3.614 [ms] (mean, across all concurrent requests)
Transfer rate:  96.21 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 4    9 52.1  11    3009
Processing:    10   27 156.2  19    3062
Waiting:       10   27 156.2  19    3061
Total:        14   36 164.7  30    3074

Percentage of the requests served within a certain time (ms)
  50%   30
  66%   32
  75%   33
  80%   33
  90%   35
  95%   40
  98%   58
  99%   73
 100% 3074 (longest request)

2回目
Concurrency Level: 10
Time taken for tests: 31.559 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 3560000 bytes
HTML transferred: 100000 bytes
Requests per second: 316.86 [#/sec] (mean)
Time per request: 31.559 [ms] (mean)
Time per request: 3.156 [ms] (mean, across all concurrent requests)
Transfer rate:  110.16 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 3    8 42.6   4    3007
Processing:    10   23 116.4  19    3021
Waiting:       10   23 116.4  19    3021
Total:        14   31 124.0  30    3033

Percentage of the requests served within a certain time (ms)
  50%   30
  66%   32
  75%   32
  80%   33
  90%   34
  95%   37
  98%   49
  99%   66
 100% 3033 (longest request)

3. $ ab -n 10000 -c 10 http://xxx.cloudfront.net/test.txt
1回目
Concurrency Level: 10
Time taken for tests: 7.469 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 4161358 bytes
HTML transferred: 100000 bytes
Requests per second: 1338.85 [#/sec] (mean)
Time per request: 7.469 [ms] (mean)
Time per request: 0.747 [ms] (mean, across all concurrent requests)
Transfer rate:  544.09 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 2    3  0.5   3  12
Processing: 3    4  3.2   4 137
Waiting: 3    4  3.2   4 137
Total:  5    7  3.3   7 140

Percentage of the requests served within a certain time (ms)
  50%    7
  66%    8
  75%    8
  80%    8
  90%    9
  95%   10
  98%   11
  99%   14
 100%  140 (longest request)
2回目
Concurrency Level: 10
Time taken for tests: 8.182 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 4190808 bytes
HTML transferred: 100000 bytes
Requests per second: 1222.17 [#/sec] (mean)
Time per request: 8.182 [ms] (mean)
Time per request: 0.818 [ms] (mean, across all concurrent requests)
Transfer rate:  500.18 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 2    3  0.7   3  23
Processing: 3    5  2.0   5  41
Waiting: 3    5  2.0   5  41
Total:  5    8  2.2   8  44

Percentage of the requests served within a certain time (ms)
  50%    8
  66%    8
  75%    9
  80%    9
  90%   10
  95%   11
  98%   13
  99%   16
 100%   44 (longest request)

4. $ ab -n 10000 -c 10 http://xxx.hoge.com/test.txt
1回目
Concurrency Level: 10
Time taken for tests: 7.836 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 4190014 bytes
HTML transferred: 100000 bytes
Requests per second: 1276.15 [#/sec] (mean)
Time per request: 7.836 [ms] (mean)
Time per request: 0.784 [ms] (mean, across all concurrent requests)
Transfer rate:  522.18 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 2    3  1.8   3  27
Processing: 3    5  2.5   4  39
Waiting: 3    4  2.4   4  39
Total:  5    8  3.2   7  53

Percentage of the requests served within a certain time (ms)
  50%    7
  66%    8
  75%    8
  80%    8
  90%    9
  95%   12
  98%   20
  99%   21
 100%   53 (longest request)
2回目
Concurrency Level: 10
Time taken for tests: 8.473 seconds
Complete requests: 10000
Failed requests: 0
Write errors:  0
Total transferred: 4191311 bytes
HTML transferred: 100000 bytes
Requests per second: 1180.20 [#/sec] (mean)
Time per request: 8.473 [ms] (mean)
Time per request: 0.847 [ms] (mean, across all concurrent requests)
Transfer rate:  483.07 [Kbytes/sec] received

Connection Times (ms)
       min  mean[+/-sd] median max
Connect: 2    3  0.6   3  17
Processing: 3    5  5.7   4 198
Waiting: 3    5  5.7   4 198
Total:  5    8  5.7   8 201

Percentage of the requests served within a certain time (ms)
  50%    8
  66%    8
  75%    9
  80%    9
  90%   11
  95%   13
  98%   17
  99%   23
 100%  201 (longest request)

0 件のコメント:

コメントを投稿