laravel octane和webman對比qps

LiuXiaoKang發表於2022-07-14

環境版本

業務:雙方都是隨機從資料庫使用者表裡面查詢一條資料
中介軟體:無
php版本8.1.7
laravel版本:8.5
mysql版本:5.7(阿里雲)
laravel容器和webman容器都在本地
程式數量:16
代理:本地nginx容器

電腦硬體

處理器 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz 2.00 GHz
機帶 RAM 16.0 GB (15.9 GB 可用)

系統版本 Windows 11 專業版

版本 22H2
安裝日期 ‎2022/‎5/‎21
作業系統版本 22621.290
體驗 Windows Feature Experience Pack 1000.22632.1000.0

laravel 帶資料庫 ab -n 10000 -c 100

Server Software: nginx
Server Hostname: 172.19.0.15
Server Port: 80

Document Path: /api/index
Document Length: 243 bytes

Concurrency Level: 100
Time taken for tests: 35.480 seconds
Complete requests: 10000
Failed requests: 7758
(Connect: 0, Receive: 0, Length: 7758, Exceptions: 0)
Total transferred: 4611690 bytes
HTML transferred: 2731690 bytes
Requests per second: 281.85 [#/sec] (mean)
Time per request: 354.803 [ms] (mean)
Time per request: 3.548 [ms] (mean, across all concurrent requests)
Transfer rate: 126.93 [Kbytes/sec] received

laravel 不帶資料庫 ab -n 10000 -c 1000 -k

Benchmarking 172.19.0.15 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software: nginx
Server Hostname: 172.19.0.15
Server Port: 80

Document Path: /api/index
Document Length: 3 bytes

Concurrency Level: 1000
Time taken for tests: 13.950 seconds
Complete requests: 10000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 1990000 bytes
HTML transferred: 30000 bytes
Requests per second: 716.87 [#/sec] (mean)
Time per request: 1394.961 [ms] (mean)
Time per request: 1.395 [ms] (mean, across all concurrent requests)
Transfer rate: 139.31 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 5 15.2 0 73
Processing: 23 1292 599.9 1506 3437
Waiting: 16 1292 600.0 1505 3437
Total: 81 1297 595.2 1506 3469

Percentage of the requests served within a certain time (ms)
50% 1506
66% 1591
75% 1633
80% 1664
90% 1957
95% 2312
98% 2600
99% 2723
100% 3469 (longest request)

webman 帶資料庫 ab -n 10000 -c 100

Server Software: nginx
Server Hostname: 172.19.0.12
Server Port: 80

Document Path: /
Document Length: 322 bytes

Concurrency Level: 100
Time taken for tests: 34.694 seconds
Complete requests: 10000
Failed requests: 9697
(Connect: 0, Receive: 0, Length: 9697, Exceptions: 0)
Total transferred: 4138843 bytes
HTML transferred: 2638843 bytes
Requests per second: 288.23 [#/sec] (mean)
Time per request: 346.943 [ms] (mean)
Time per request: 3.469 [ms] (mean, across all concurrent requests)
Transfer rate: 116.50 [Kbytes/sec] received

webman 不帶資料庫 ab -n 10000 -c 1000 -k

Benchmarking 172.19.0.12 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software: nginx/1.21.6
Server Hostname: 172.19.0.12
Server Port: 80

Document Path: /
Document Length: 3 bytes

Concurrency Level: 1000
Time taken for tests: 0.257 seconds
Complete requests: 10000
Failed requests: 0
Keep-Alive requests: 10000
Total transferred: 1630000 bytes
HTML transferred: 30000 bytes
Requests per second: 38845.51 [#/sec] (mean)
Time per request: 25.743 [ms] (mean)
Time per request: 0.026 [ms] (mean, across all concurrent requests)
Transfer rate: 6183.42 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 12.8 0 62
Processing: 2 18 9.6 15 62
Waiting: 1 18 9.6 15 55
Total: 2 22 17.4 16 106

Percentage of the requests served within a certain time (ms)
50% 16
66% 23
75% 27
80% 29
90% 47
95% 65
98% 79
99% 84
100% 106 (longest request)

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章