我在我的机器上测试了一下doophp和kohana3,看起来doophp也不是那么快
hello world 测试
D:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -t 30 -c 10 http://
test.com/doo/app
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.2.14
Server Hostname: test.com
Server Port: 80
Document Path: /doo/app
Document Length: 232 bytes
Concurrency Level: 10
Time taken for tests: 20.250 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Non-2xx responses: 50000
Total transferred: 23250000 bytes
HTML transferred: 11600000 bytes
Requests per second: 2469.14 [#/sec] (mean)
Time per request: 4.050 [ms] (mean)
Time per request: 0.405 [ms] (mean, across all concurrent requests)
Transfer rate: 1121.24 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 16
Processing: 0 4 6.7 0 16
Waiting: 0 4 6.5 0 16
Total: 0 4 6.8 0 16
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 16
80% 16
90% 16
95% 16
98% 16
99% 16
100% 16 (longest request)
D:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -t 30 -c 10 http://
test.com/kohana
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.2.14
Server Hostname: test.com
Server Port: 80
Document Path: /kohana
Document Length: 231 bytes
Concurrency Level: 10
Time taken for tests: 20.859 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Non-2xx responses: 50000
Total transferred: 23150000 bytes
HTML transferred: 11550000 bytes
Requests per second: 2397.00 [#/sec] (mean)
Time per request: 4.172 [ms] (mean)
Time per request: 0.417 [ms] (mean, across all concurrent requests)
Transfer rate: 1083.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 16
Processing: 0 4 7.1 0 188
Waiting: 0 4 6.9 0 188
Total: 0 4 7.2 0 188
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 16
80% 16
90% 16
95% 16
98% 16
99% 16
100% 188 (longest request)
数据库查询测试
(好像doophp的链接用的PDO,而kohana3不需要PDO,另外,kohana3不是使用orm,是直接使用db)
D:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -t 30 -c 10 http://
test.com/doo/app
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking test.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: Apache/2.2.14
Server Hostname: test.com
Server Port: 80
Document Path: /doo/app
Document Length: 232 bytes
Concurrency Level: 10
Time taken for tests: 19.328 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Non-2xx responses: 50000
Total transferred: 23250000 bytes
HTML transferred: 11600000 bytes
Requests per second: 2586.90 [#/sec] (mean)
Time per request: 3.866 [ms] (mean)
Time per request: 0.387 [ms] (mean, across all concurrent requests)
Transfer rate: 1174.72 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 31
Processing: 0 4 6.6 0 31
Waiting: 0 3 6.3 0 31
Total: 0 4 6.7 0 31
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 16
90% 16
95% 16
98% 16
99% 16
100% 31 (longest request)
D:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -t 30 -c 10 http://
test.com/kohana
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking test.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: Apache/2.2.14
Server Hostname: test.com
Server Port: 80
Document Path: /kohana
Document Length: 231 bytes
Concurrency Level: 10
Time taken for tests: 18.063 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Non-2xx responses: 50000
Total transferred: 23150000 bytes
HTML transferred: 11550000 bytes
Requests per second: 2768.17 [#/sec] (mean)
Time per request: 3.612 [ms] (mean)
Time per request: 0.361 [ms] (mean, across all concurrent requests)
Transfer rate: 1251.62 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.5 0 16
Processing: 0 3 6.4 0 16
Waiting: 0 3 6.2 0 16
Total: 0 4 6.5 0 16
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 16
90% 16
95% 16
98% 16
99% 16
100% 16 (longest request)
从结果看,doophp的速度比kohana稍微快点,但是doophp使用的是默认设置,估计模块不多,所以速度快点,而kohana3载入了所有自带的模块,数据库查询使用(DB::select('*')->from('food')->execute())而不是orm,从结果看kohana3的数据库查询效率还可以.
测试环境
CPU:E5300
MEM:1G
windows XP
apache 2.2.14
php 5.2.2
mysql 5.1
发表讨论