|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-03-25 06:01 UTC] pcdinh at gmail dot com
Description: ------------ APC makes Apache 2.2.4 unusable, immediately crashed when performing stress test with Apache Bench. Testing with my framework and Zend Framework Reproduce code: --------------- I try to make a benchmark with Zend Framework using Rob code http://akrabat.com/wp-content/uploads/zf-tutorial_130.zip Batch code: @ECHO OFF ECHO Apache Bench Ready. c:\server\apache2.2\bin\ab -t 60 -c 20 http://localhost/iphilia/zend/ PAUSE APC config [APC] apc.enabled=1 apc.shm_segments=1 apc.shm_size=64 apc.optimization=0 apc.num_files_hint=1000 apc.ttl=0 apc.gc_ttl=3600 apc.cache_by_default=On apc.slam_defense=0 apc.file_update_protection=2 apc.enable_cli=0 apc.stat=0 Expected result: ---------------- The benchmark should be done smoothly with APC-enabled. Actually, when APC is disabled, no error occurs Actual result: -------------- Apache 2.2.4 crashed immediately. Apache error.log said [Sun Mar 25 17:46:07 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.1 configured -- resuming normal operations [Sun Mar 25 17:46:07 2007] [notice] Server built: Jan 9 2007 23:17:20 [Sun Mar 25 17:46:07 2007] [notice] Parent: Created child process 496 [Sun Mar 25 17:46:07 2007] [notice] Child 496: Child process is running [Sun Mar 25 17:46:07 2007] [notice] Child 496: Acquired the start mutex. [Sun Mar 25 17:46:07 2007] [notice] Child 496: Starting 250 worker threads. [Sun Mar 25 17:46:08 2007] [notice] Child 496: Starting thread to listen on port 80. [Sun Mar 25 17:46:20 2007] [apc-error] Cannot redeclare class zend_registry Error in my_thread_global_end(): 252 threads didn't exit When testing APC with my OOP classes, APC causes this kind of error: Cannot redeclare class [class_name_here]. When I disable APC, this kind of error does not occur PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
apc.stat = 0 cannot be used with TSRM mode due to a few quirks in current implementation. I'll take a closer look at the class redeclare error assuming it is happening in php5 ? The error is due to the weirdness in class naming/mangling that zend does internally. Everytime Zend compiles a file, it generates a new & unique internal name - which APC cannot duplicate because it serves out the same opcode dump for every request. So multiple inclusion of the same file or code like if(class_exists('x')) { class x {} } and even combinations of __autoload based class loading can cause such anomalies. I'm trying to document such APC gotchas, but the issues generally show up only at high load and debugging it is mostly guesswork.