初始數值 - Kantai235/laravel-typical-high-load-example GitHub Wiki

初始數值

在開始系統架構之前,我們需要先了解到在一般正常情況下,伺服器與資料庫毫無任何處理,接收到請求就固定回傳一個空白頁面的情況下,分別測試 10 個連線 300 次連續點擊、100 個連線 600 次連續點擊、300 個連線 1500 次連續點擊,各自會得到的數值。

首先以測試 10 個連線 300 次連續點擊開始。

This is ApacheBench, Version 2.3 <$Revision: 1874286 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking laravel-typical-high-load-exam.herokuapp.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Finished 300 requests

Server Software:        nginx
Server Hostname:        laravel-typical-high-load-exam.herokuapp.com
Server Port:            80

Document Path:          /
Document Length:        3195 bytes

Concurrency Level:      10
Time taken for tests:   61.535 seconds
Complete requests:      300
Failed requests:        0
Total transferred:      1318200 bytes
HTML transferred:       958500 bytes
Requests per second:    4.88 [#/sec] (mean)
Time per request:       2051.179 [ms] (mean)
Time per request:       205.118 [ms] (mean, across all concurrent requests)
Transfer rate:          20.92 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      200  203   1.9    202     213
Processing:   266 1799 191.4   1825    2230
Waiting:      266 1127 463.2   1212    2230
Total:        468 2001 191.3   2028    2435

Percentage of the requests served within a certain time (ms)
  50%   2028
  66%   2032
  75%   2033
  80%   2034
  90%   2038
  95%   2041
  98%   2044
  99%   2227
 100%   2435 (longest request)

接著測試100 個連線 600 次連續點擊,我們可以明顯地看到連線時間(Connection Times)的部分急遽上升。

This is ApacheBench, Version 2.3 <$Revision: 1874286 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking laravel-typical-high-load-exam.herokuapp.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Finished 600 requests

Server Software:        nginx
Server Hostname:        laravel-typical-high-load-exam.herokuapp.com
Server Port:            80

Document Path:          /
Document Length:        3195 bytes

Concurrency Level:      100
Time taken for tests:   121.943 seconds
Complete requests:      600
Failed requests:        0
Total transferred:      2636400 bytes
HTML transferred:       1917000 bytes
Requests per second:    4.92 [#/sec] (mean)
Time per request:       20323.827 [ms] (mean)
Time per request:       203.238 [ms] (mean, across all concurrent requests)
Transfer rate:          21.11 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      198  202   2.0    202     213
Processing:   265 18364 4428.0  20027   20286
Waiting:      265 10005 5811.2   9935   20057
Total:        469 18567 4427.9  20229   20490

Percentage of the requests served within a certain time (ms)
  50%  20229
  66%  20236
  75%  20239
  80%  20241
  90%  20246
  95%  20250
  98%  20259
  99%  20264
 100%  20490 (longest request)

最後測試 300 個連線 1500 次連續點擊,可以明顯地看到連線時間(Connection Times)的部分急遽上升以外,觀察到平均每秒可回應要求(Requests per second)大約著落於每秒可以處理大約接近 5 個回應。

This is ApacheBench, Version 2.3 <$Revision: 1874286 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking laravel-typical-high-load-exam.herokuapp.com (be patient)
Completed 150 requests
Completed 300 requests
Completed 450 requests
Completed 600 requests
Completed 750 requests
Completed 900 requests
Completed 1050 requests
Completed 1200 requests
Completed 1350 requests
Completed 1500 requests
Finished 1500 requests

Server Software:        nginx
Server Hostname:        laravel-typical-high-load-exam.herokuapp.com
Server Port:            80

Document Path:          /
Document Length:        3195 bytes

Concurrency Level:      300
Time taken for tests:   310.193 seconds
Complete requests:      1500
Failed requests:        0
Total transferred:      6591000 bytes
HTML transferred:       4792500 bytes
Requests per second:    4.84 [#/sec] (mean)
Time per request:       62038.680 [ms] (mean)
Time per request:       206.796 [ms] (mean, across all concurrent requests)
Transfer rate:          20.75 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      202  206   2.3    206     222
Processing:   282 55533 14705.2  61684   62746
Waiting:      282 30780 17866.9  30742   61755
Total:        489 55740 14705.3  61890   62955

Percentage of the requests served within a certain time (ms)
  50%  61890
  66%  61911
  75%  61929
  80%  61940
  90%  61953
  95%  61962
  98%  61978
  99%  61985
 100%  62955 (longest request)