转自: http://blog.digitalstruct.com/2007/12/23/php-accelerators-apc-vs-zend-vs-xcache-with-zend-framework/
Tonight I wanted to see how the Zend Framework would run against an application that I have put in quite a bit of components into. I figured with the amount of objects that have been instanciated that there was likely going to be a larger performance hit overall. These results may surprise you with what really made a difference as far as PHP Accelerators.
Zend Framework : Release 1.0.3
- Zend_Cache
- Zend_Config
- Zend_Config_Xml
- Zend_Db
- Zend_Db_Table
- Zend_Registry
- Zend_Loader
- Zend_Controller_Front
- Zend_Auth
- Zend_Acl
- Zend_Acl_Role
- Zend_Acl_Resource
- Zend_Session
- Zend_Session_Namespace
Testing Environment
- PHP 5.2.5
- Apache 2.2.6
Test Results
Pure PHP
Concurrency Level: 10
Time taken for tests: 60.655071 seconds
Complete requests: 298
Failed requests: 0
Write errors: 0
Total transferred: 643149 bytes
HTML transferred: 516971 bytes
Requests per second: 4.91 [#/sec] (mean)
Time per request: 2035.405 [ms] (mean)
Time per request: 203.541 [ms] (mean, across all concurrent requests)
Transfer rate: 10.35 [Kbytes/sec] received
APC
Concurrency Level: 10
Time taken for tests: 60.106697 seconds
Complete requests: 914
Failed requests: 0
Write errors: 0
Total transferred: 1962675 bytes
HTML transferred: 1582035 bytes
Requests per second: 15.21 [#/sec] (mean)
Time per request: 657.623 [ms] (mean)
Time per request: 65.762 [ms] (mean, across all concurrent requests)
Transfer rate: 31.88 [Kbytes/sec] received
Zend Optimizer
Concurrency Level: 10
Time taken for tests: 60.302711 seconds
Complete requests: 262
Failed requests: 0
Write errors: 0
Total transferred: 564135 bytes
HTML transferred: 454727 bytes
Requests per second: 4.34 [#/sec] (mean)
Time per request: 2301.630 [ms] (mean)
Time per request: 230.163 [ms] (mean, across all concurrent requests)
Transfer rate: 9.12 [Kbytes/sec] received
XCache
Concurrency Level: 10
Time taken for tests: 60.261114 seconds
Complete requests: 292
Failed requests: 0
Write errors: 0
Total transferred: 628485 bytes
HTML transferred: 506597 bytes
Requests per second: 4.85 [#/sec] (mean)
Time per request: 2063.737 [ms] (mean)
Time per request: 206.374 [ms] (mean, across all concurrent requests)
Transfer rate: 10.17 [Kbytes/sec] received
Conclusions
What I find quite interesting about this, is that APC was the only one to provide a much higher amount of requests while all the others slowed the requests down. I believe this may be related to utilizing the Zend_Loader functionality which also slows some items down for anything attempting to optimize and cache. I believe after I change that I am going to run these tests again and see if there is any large speed changes. I will post more about this more than likely in a week or so.