开发者

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

开发者 https://www.devze.com 2023-01-01 00:35 出处:网络
I have an Apache/2.2.15 (VC9) and PHP/5.3.2 (VC9 thread safe) running as an apache module on Vista 64bi开发者_运维技巧t machine. All running fine.

I have an Apache/2.2.15 (VC9) and PHP/5.3.2 (VC9 thread safe) running as an apache module on Vista 64bi开发者_运维技巧t 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 0.15 seconds.

After I've installed APC (3.1.4-dev VC9 thread safe) with standard settings suddenly the request response time raised to 1.3 seconds (!), which is unacceptable... All apc settings looked always good (through the apc.php script: enough shm memory, no cache full, fragmentation 0%).

Only difference was to disable the stats lookup (apc.stat = 0). Then the response dropped to 0.09 seconds which was finally better than without the 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消