tags:

views:

296

answers:

3

Hi,

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 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?

Apparently, something is not working as it should, I don't really know where to start looking. Thank you for your time/answers/direction in advance.

Cheers, m.

+1  A: 

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.

symcbean
+1  A: 

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.

M.M.
A: 

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.

Steve-o