简体   繁体   中英

APC decreasing php performance??? (php 5.3, apache 2.2, windows vista 64bit)

I have an Apache/2.2.15 (VC9) and PHP/5.3.2 (VC9 thread safe) running as an apache module on Vista 64bit machine. All running fine.

Project that I'm benchmarking (with apache's ab utility) is basically standard Zend Framework project with no db connection involved. Average (median) apache response is about .

After I've installed APC (3.1.4-dev VC9 thread safe) with standard settings suddenly the request response time raised to , which is unacceptable... All apc settings looked always good (through the apc.php script: enough shm memory, no cache full, fragmentation 0%). ,这是不可接受的...所有apc设置看起来总是很好(通过apc.php脚本:足够的shm内存,没有高速缓存已满,碎片0%)。

Only difference was to disable the stats lookup (apc.stat = 0). Then the response dropped to which was finally better than without the apc. ,这最终比没有apc时更好。 IIRC, it's expected and obvious that the stat lookup creates some overhead, but shouldn't it still be far more performant compared to running wihout the apc extension at all?

Or put it differently why is the apc.stat creating so much overhead?

It sounds like the stat check is bypassing the file cache - but I'd like to think that even Microsoft NT can ensure that the file cache is consistent.

(FWIW: my experience with apc was that it gave a big improvement on Linux)

I'd suggest trying a different filesystem - but with NT there's not much of a choice.

If you're confident of your results (did you reboot between tests or just restart Apache?) then post a bug at http://bugs.php.net/ (there doesn't seem to be anything obviously related there already)

C.

Edit

..athough it just occurred to me - what's happening to your system memory while running the tests? If you've used up all your physical memory with instances of ab then you'll have NO file cache.

Update : I have found out that the major slowdow was caused by an antivirus software... I don't understand why that happens (why only with apc), but it's no issue anymore (NOTE: this is a dev machine)

Now if running with apc (apc.stat = 1) the response times are around 0.13 sec which a little bit better than without the apc ( 0.15 sec ). It's lot less better than expected, but I'll leave that for now...

Thanks symcbean for answering.

Anti-virus is stupid, it's going to think that every time APC runs and generates output there is a new application and going to re-scan it. You should see an improvement if you disable caching "apc.cache_by_default=Off" although it would be better to simply disable the AV from scanning the compiled files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM