Open pei0804 opened 7 years ago
44px/s
700/s
222pv/s
3552/s
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 78293 hits
Availability: 99.88 %
Elapsed time: 76.41 secs
Data transferred: 62.98 MB
Response time: 0.63 secs
Transaction rate: 1024.64 trans/sec
Throughput: 0.82 MB/sec
Concurrency: 649.64
Successful transactions: 78721
Failed transactions: 95
Longest transaction: 56.76
Shortest transaction: 0.00
CPU: 100%
memory: 450MB
1台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 47269 hits
Availability: 100.00 %
Elapsed time: 29.62 secs
Data transferred: 104.72 MB
Response time: 0.21 secs
Transaction rate: 1595.85 trans/sec
Throughput: 3.54 MB/sec
Concurrency: 336.14
Successful transactions: 47526
Failed transactions: 0
Longest transaction: 7.02
Shortest transaction: 0.00
CPU: 80%
memory: 380MB
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
結果
1台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
結果
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
1台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
APとDBを分ける
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 20172 hits
Availability: 100.00 %
Elapsed time: 22.25 secs
Data transferred: 47.37 MB
Response time: 0.65 secs
Transaction rate: 906.61 trans/sec
Throughput: 2.13 MB/sec
Concurrency: 588.05
Successful transactions: 20703
Failed transactions: 0
Longest transaction: 4.57
APとDBを分ける
1台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 132893 hits
Availability: 100.00 %
Elapsed time: 85.98 secs
Data transferred: 295.90 MB
Response time: 0.03 secs
Transaction rate: 1545.63 trans/sec
Throughput: 3.44 MB/sec
Concurrency: 39.10
Successful transactions: 133587
Failed transactions: 0
Longest transaction: 2.17
Shortest transaction: 0.00
APとDBを分ける
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 62815 hits
Availability: 100.00 %
Elapsed time: 43.87 secs
Data transferred: 136.92 MB
Response time: 0.04 secs
Transaction rate: 1431.84 trans/sec
Throughput: 3.12 MB/sec
Concurrency: 58.79
Successful transactions: 63475
Failed transactions: 0
Longest transaction: 2.31
Shortest transaction: 0.00
DATABASEにのみ負荷かける
3552pv 222px x 4枠 x 4req
900
900
APとDBを分ける
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 36526 hits
Availability: 100.00 %
Elapsed time: 38.29 secs
Data transferred: 1.50 MB
Response time: 0.74 secs
Transaction rate: 953.93 trans/sec
Throughput: 0.04 MB/sec
Concurrency: 703.61
Successful transactions: 36526
Failed transactions: 0
Longest transaction: 33.10
Shortest transaction: 0.02
APとDBを分ける
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
結果
Transactions: 12440 hits
Availability: 100.00 %
Elapsed time: 9.63 secs
Data transferred: 9.71 MB
Response time: 0.16 secs
Transaction rate: 1291.80 trans/sec
Throughput: 1.01 MB/sec
Concurrency: 208.17
Successful transactions: 12916
Failed transactions: 0
Longest transaction: 3.34
Shortest transaction: 0.00
APとDBを分ける
2台から以下のコマンド、リクエストを実行
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 32176 hits
Availability: 100.00 %
Elapsed time: 38.06 secs
Data transferred: 12.80 MB
Response time: 0.05 secs
Transaction rate: 845.40 trans/sec
Throughput: 0.34 MB/sec
Concurrency: 41.48
Successful transactions: 32176
Failed transactions: 0
Longest transaction: 3.09
Shortest transaction: 0.00
結論:Nginxは2台までスケールアウトすれば余裕だ。MySQLは1台でよろしい。
siege -c 1000 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 303768 hits
Availability: 100.00 %
Elapsed time: 231.40 secs
Data transferred: 672.92 MB
Response time: 0.27 secs
Transaction rate: 1312.74 trans/sec
Throughput: 2.91 MB/sec
Concurrency: 351.73
Successful transactions: 304702
Failed transactions: 0
Longest transaction: 15.05
Shortest transaction: 0.00
CPU:60~80%
siege -c 900 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
Transactions: 203793 hits
Availability: 100.00 %
Elapsed time: 152.22 secs
Data transferred: 451.78 MB
Response time: 0.24 secs
Transaction rate: 1338.81 trans/sec
Throughput: 2.97 MB/sec
Concurrency: 324.95
Successful transactions: 204352
Failed transactions: 0
Longest transaction: 7.27
Shortest transaction: 0.00
CPU: 60% ~ 70%
siege -c 800 -f siege.txt
siege.txt
http://133.242.51.115/ad_1.html
http://133.242.51.115/revive/www/delivery/asyncspc.php?zones=1&prefix=revive-0-&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html
http://133.242.51.115/revive/www/images/046fec30699207a354b8bb103f9d8ace.png
http://133.242.51.115/revive/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=1&loc=http%3A%2F%2F133.242.51.115%2Fad_1.html&referer=http%3A%2F%2F133.242.51.115%2Fad_1.html&cb=4f53bdabd1
結果
CPU: 60% ~ 70%
APサーバーは1000捌けます。 APサーバーは4台居るよね。
1台のAPサーバ
1000requests:1595.85 trans/sec
2000requests:1024.64 trans/sec
通常時
通常時は700requests想定なので問題ない.
2000requestsで1024.64 trans/sec
のなので多少の増減には耐えられる
=> 通常時は1台で運用できる
イベント時
3552requests想定.
イベントは事前に予測できるため,そのときだけAPサーバをスケールアウトする.
3552 / 1台1000requests ≒ 4台
https://github.com/YuiOmata/sunrise/issues/13#issuecomment-264619598