1
ab -n 10000 -c 200
  • 测试机为腾讯云1核1G普通云硬盘,如果用ssd的话php成绩会有所提升
  • 输出内容为时间戳

    beego swoft的性能都强的不得了,在同一级别,
    裸跑性能都逼近nginx处理静态文件
    nginx转发损耗很大,由于nginx转发会导致thinkphp,swoft,beego的性能几乎一样。
    所以有可能的话还是不要在这些框架外套个nginx了
    swoft+nginx:内存无波动,CPU占用81%
    swoft无nginx:内存无波动,CPU占用34%

thinkphp+nginx

412

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 24.256 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 1940000 bytes
HTML transferred: 190000 bytes
Requests per second: 412.28 [#/sec] (mean)
Time per request: 485.111 [ms] (mean)
Time per request: 2.426 [ms] (mean, across all concurrent requests)
Transfer rate: 78.11 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 89 276 34.2 274 394
Processing: 88 204 31.5 206 371
Waiting: 86 204 31.6 205 370
Total: 307 480 46.9 481 685

Percentage of the requests served within a certain time (ms)
50% 481
66% 500
75% 512
80% 519
90% 539
95% 554
98% 571
99% 587
100% 685 (longest request)

yaf+nginx

445

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Concurrency Level:      200
Time taken for tests: 22.467 seconds
Complete requests: 10000
Failed requests: 2
(Connect: 0, Receive: 0, Length: 1, Exceptions: 1)
Total transferred: 1939806 bytes
HTML transferred: 189981 bytes
Requests per second: 445.10 [#/sec] (mean)
Time per request: 449.332 [ms] (mean)
Time per request: 2.247 [ms] (mean, across all concurrent requests)
Transfer rate: 84.32 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 348 472.5 118 4888
Processing: 24 83 127.4 36 7012
Waiting: 24 82 106.9 36 1876
Total: 97 430 479.7 324 7012

Percentage of the requests served within a certain time (ms)
50% 324
66% 361
75% 391
80% 582
90% 1128
95% 1360
98% 1815
99% 2061
100% 7012 (longest request)

nginx(静态页)

2157

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 4.635 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2430000 bytes
HTML transferred: 190000 bytes
Requests per second: 2157.36 [#/sec] (mean)
Time per request: 92.706 [ms] (mean)
Time per request: 0.464 [ms] (mean, across all concurrent requests)
Transfer rate: 511.95 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 50 152.6 30 3042
Processing: 24 38 42.2 30 507
Waiting: 24 38 42.2 30 507
Total: 47 87 161.7 60 3077

Percentage of the requests served within a certain time (ms)
50% 60
66% 61
75% 71
80% 71
90% 71
95% 80
98% 307
99% 1062
100% 3077 (longest request)

beego(无nginx)

1722

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 5.808 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 1360000 bytes
HTML transferred: 190000 bytes
Requests per second: 1721.62 [#/sec] (mean)
Time per request: 116.170 [ms] (mean)
Time per request: 0.581 [ms] (mean, across all concurrent requests)
Transfer rate: 228.65 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 67 189.1 30 1041
Processing: 24 42 52.7 30 499
Waiting: 24 42 52.7 30 499
Total: 48 109 204.8 60 1526

Percentage of the requests served within a certain time (ms)
50% 60
66% 61
75% 71
80% 71
90% 72
95% 294
98% 1061
99% 1073
100% 1526 (longest request)

swoft(无nginx)

1748

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 5.722 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2030000 bytes
HTML transferred: 190000 bytes
Requests per second: 1747.79 [#/sec] (mean)
Time per request: 114.430 [ms] (mean)
Time per request: 0.572 [ms] (mean, across all concurrent requests)
Transfer rate: 346.49 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 62 188.5 30 3043
Processing: 24 44 52.9 31 508
Waiting: 24 44 52.9 31 507
Total: 48 106 201.6 61 3079

Percentage of the requests served within a certain time (ms)
50% 61
66% 71
75% 71
80% 72
90% 83
95% 294
98% 1062
99% 1073
100% 3079 (longest request)

beego+nginx

445

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 22.482 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2150000 bytes
HTML transferred: 190000 bytes
Requests per second: 444.81 [#/sec] (mean)
Time per request: 449.632 [ms] (mean)
Time per request: 2.248 [ms] (mean, across all concurrent requests)
Transfer rate: 93.39 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 73 341 511.6 112 8923
Processing: 24 61 79.2 36 1881
Waiting: 24 61 79.2 36 1881
Total: 97 402 517.4 176 8961

Percentage of the requests served within a certain time (ms)
50% 176
66% 348
75% 376
80% 401
90% 1125
95% 1341
98% 1804
99% 2252
100% 8961 (longest request)

swoft+nginx

444

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Concurrency Level:      200
Time taken for tests: 22.518 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2320000 bytes
HTML transferred: 160000 bytes
Requests per second: 444.08 [#/sec] (mean)
Time per request: 450.369 [ms] (mean)
Time per request: 2.252 [ms] (mean, across all concurrent requests)
Transfer rate: 100.61 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 73 345 578.1 110 15747
Processing: 24 63 85.8 36 986
Waiting: 24 63 85.8 36 986
Total: 98 408 585.9 156 15784

Percentage of the requests served within a certain time (ms)
50% 156
66% 356
75% 377
80% 395
90% 1122
95% 1369
98% 2103
99% 3092
100% 15784 (longest request)