【发布时间】:2014-01-14 15:57:22
【问题描述】:
我已经安装了centos6 + apache(后端)+ nginx(前端)+ APC。如果使用以下命令对其进行基准测试:
ab -n 1000 -c 100 http://domain.com/index.html
Server Software: nginx/1.0.15
Server Hostname: domain.com
Server Port: 80
Document Path: /index.html
Document Length: 1423 bytes
Concurrency Level: 100
Time taken for tests: 0.109 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 1730000 bytes
HTML transferred: 1423000 bytes
Requests per second: 9173.81 [#/sec] (mean)
Time per request: 10.901 [ms] (mean)
Time per request: 0.109 [ms] (mean, across all concurrent requests)
Transfer rate: 15498.72 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 1.5 1 6
Processing: 3 8 2.4 8 16
Waiting: 1 7 2.9 7 16
Total: 6 10 1.8 10 17
Percentage of the requests served within a certain time (ms)
50% 10
66% 11
75% 11
80% 11
90% 13
95% 13
98% 14
99% 15
100% 17 (longest request)
我每秒收到9173.81 个请求,但如果使用命令:
ab -n 1000 -c 100 http://domain.com/index.**php**
文件内容相同,但扩展名为*.php。
Server Software: nginx/1.0.15
Server Hostname: domain.com
Server Port: 80
Document Path: /test.php
Document Length: 902 bytes
Concurrency Level: 100
Time taken for tests: 1.277 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 1109000 bytes
HTML transferred: 902000 bytes
Requests per second: 783.38 [#/sec] (mean)
Time per request: 127.652 [ms] (mean)
Time per request: 1.277 [ms] (mean, across all concurrent requests)
Transfer rate: 848.41 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 4.8 0 18
Processing: 4 122 34.7 138 162
Waiting: 2 122 34.8 138 162
Total: 21 123 33.4 139 168
Percentage of the requests served within a certain time (ms)
50% 139
66% 150
75% 151
80% 152
90% 159
95% 161
98% 162
99% 162
100% 168 (longest request)
我每秒收到783.38 个请求。为什么分数相差这么大?这是一个相同的文件。
【问题讨论】:
-
同一个文件处理方式不同。使用 DHL 和普通邮件发送信封。相同的邮件 - 但会在不同的时间送达
标签: php apache optimization nginx centos