[root@localhost lib]# /usr/local/php/bin/php -v
PHP 5.2.4 (cli) (built: Jun 18 2008 15:25:28)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
[root@localhost lib]# cd /usr/local/apache2/bin/
[root@localhost bin]# ./ab -n 100 -c 10
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Copyright 2006 The Apache Software Foundation,
Benchmarking 192.168.8.2 (be patient).....done
Server Software: Apache/2.2.6
Server Hostname: 192.168.8.2
Server Port: 80
Document Path: /phpMyAdmin/index.php
Document Length: 2473 bytes
Concurrency Level: 10
Time taken for tests: 2.835400 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 355376 bytes
HTML transferred: 247300 bytes
Requests per second: 35.27 [#/sec] (mean)
Time per request: 283.540 [ms] (mean)
Time per request: 28.354 [ms] (mean, across all concurrent requests)
Transfer rate: 122.38 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 16 53.8 0 200
Processing: 75 260 248.1 177 1261
Waiting: 75 258 242.1 177 1141
Total: 75 277 256.6 178 1301
Percentage of the requests served within a certain time (ms)
50% 178
66% 231
75% 342
80% 382
90% 674
95% 895
98% 1261
99% 1301
100% 1301 (longest request)
[root@localhost bin]# ./ab -n 100 -c 10
[1] 19266
[2] 19267
[3] 19268
[root@localhost bin]# This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Copyright 2006 The Apache Software Foundation,
Benchmarking 192.168.8.2 (be patient).....done
Server Software: Apache/2.2.6
Server Hostname: 192.168.8.2
Server Port: 80
Document Path: /phpMyAdmin/sql.php?db=oa
Document Length: 4115 bytes
Concurrency Level: 10
Time taken for tests: 3.46011 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 526186 bytes
HTML transferred: 411500 bytes
Requests per second: 32.83 [#/sec] (mean)
Time per request: 304.601 [ms] (mean)
Time per request: 30.460 [ms] (mean, across all concurrent requests)
Transfer rate: 168.42 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 6.5 0 23
Processing: 28 296 354.0 147 1516
Waiting: 28 296 354.2 147 1516
Total: 28 298 354.0 147 1516
Percentage of the requests served within a certain time (ms)
50% 147
66% 353
75% 387
80% 417
90% 704
95% 1433
98% 1473
99% 1516
100% 1516 (longest request)
[1] Done ./ab -n 100 -c 10
[2]- Done token=22ea2351885ebf84c09428ac7a2feb88
[3]+ Done table=task
测试后发现eaccelerator将php执行速度提升了近2-3倍
参考文章: