No performance gain with APC on WampServer
Asked Answered
T

2

3

I'm working on a Windows workstation, on which I use WampServer as my development platform, to write PHP applications which are then run on Linux.

I'm pretty used to APC on Linux, which is blazing fast and a must have for me. However, I'm always surprised to get no performance gain when I use it on Windows.

This leads to generation times close to 1 second per page, on applications relying heavily on the Zend Framework for example. Most of this time is spent parsing PHP files (I verified that by benchmarking include()s). The very same application can run 10x faster on Linux on MacOS.

The extension is properly loaded:

> var_export(extension_loaded('apc'));
true

Here is my config:

[APC] 
apc.enabled = 1 
apc.cache_by_default = 1 
apc.enable_cli = 0 
apc.shm_segments = 1 
apc.shm_size = 64M
apc.max_file_size = 1M 
apc.stat=1 

Did anyone have a similar experience and has a few tips to share?

Edit: more information: I copied the apc.php file from the APC source archive to my web directory. There, I can see that the APC cache is at work, reporting more than 90% hits vs misses. Still, the speed does not increase though. It takes half a second to include a few dozen files from the framework, with or without APC. And on an equivalent machine on Linux, it's 10x faster.

Thrill answered 4/7, 2011 at 18:35 Comment(5)
Try to execute $t = new APCIterator('user'); on your Windows.Anile
@OZ_: what is it supposed to do?Thrill
if you'll see the error warning - APC is not enabled.Anile
@OZ_: var_dump($t) gives object(APCIterator)#5 (0) {} as expected. APC is enabled.Thrill
Update: I'm now getting this problem on Linux & PHP 5.4 too.Thrill
T
0

I haven't found a solution to this problem so far, so I ended up trying Zend Server CE, and I can now notice the expected performance improvement when APC is enabled.

Not really a solution to my question, rather a workaround, but after one month of use, I'm pretty happy with Zend Server on my development machine.

Thrill answered 19/12, 2011 at 11:53 Comment(0)
S
0

I use WampServer and APC a lot with CakePHP and Drupal. I always notice a difference when using APC versus not.

It could be that your application is very heavy. Or that your desktop is that much slower than your servers that the APC file caching is not making a difference. APC reads the files into memory but your computer still has to process them.

Strake answered 19/8, 2011 at 1:18 Comment(0)
T
0

I haven't found a solution to this problem so far, so I ended up trying Zend Server CE, and I can now notice the expected performance improvement when APC is enabled.

Not really a solution to my question, rather a workaround, but after one month of use, I'm pretty happy with Zend Server on my development machine.

Thrill answered 19/12, 2011 at 11:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.