安装环境
centos7
apache2.4
php5.4
均使用YUM安装。
默认配置。
创建phpinfo
echo "<?php phpinfo(); ?>" >> /home/www/html/index.php
使用ab,phpinfo进行测试
出现socket错误继续进行(-r Don‘t exit on socket receive errors.)
第一次测试
ab -r -n 20000 -c 2000 ‘http://127.0.0.1/index.php‘
测试期间,新建一个会话,统计httpd进程数。
ps -ef|grep httpd|wc -l 259
最多的时候是259个进程,基本符合默认配置最多256个httpd进程
测试结果
Document Path: /index.php Document Length: 47425 bytes Concurrency Level: 2000 Time taken for tests: 25.896 seconds Complete requests: 20000 Failed requests: 3613 (Connect: 0, Receive: 473, Length: 2667, Exceptions: 473) Write errors: 0 Total transferred: 920355599 bytes HTML transferred: 916817843 bytes Requests per second: 772.31 [#/sec] (mean) Time per request: 2589.639 [ms] (mean) Time per request: 1.295 [ms] (mean, across all concurrent requests) Transfer rate: 34706.95 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 135 508.1 12 3023 Processing: 10 575 2848.7 34 24849 Waiting: 0 49 269.6 23 20994 Total: 23 710 2982.3 45 24849 Percentage of the requests served within a certain time (ms) 50% 45 66% 46 75% 47 80% 51 90% 250 95% 3228 98% 14225 99% 14412 100% 24849 (longest request)
时间: 2024-10-10 04:17:42