Most Stable APC Version?

I’m using a VPS with a couple of Wordpress sites, 1 vBulletin site, and most importantly some Yii-built sites.

I would like to know which versions of APC and PHP work well together. I’ve experienced some problems with using PHP 5.3.2 and APC 3.1.3p1 (and 3.1.4). What I got were intermittent “Unable to allocate memory for pool” errors - these errors sometimes even show up in my Wordpress sites.

These are the APC settings I used:

apc.cache_by_default		1


apc.enable_cli		1


apc.enabled		0


apc.mmap_file_mask		/tmp/apc.XXXXXX


apc.num_files_hint		1024


apc.optimization		0


apc.shm_segments		1


apc.shm_size		32


apc.ttl		7200


apc.user_ttl		7200

I’m keen on getting APC to work, even if it means downgrading to an older PHP version.

Please help. Many thanks.

Hi adbie,

although it’s more of a general PHP issue than one regarding Yii, I’d like to help with a little tip-off.

I have a server up and running on Ubuntu 10.04 LTS with the latest Apache2, running PHP 5.3.2.1, using eAccelerator 0.9.6.1, and it blew my mind how fast my sites are now delivered using eAcc. I can really recommend to use it. In combination with using cache and compression in Apache, you’ll be surprised about the enormous speed boost.

Nevertheless, if you really want to use APC, please check http://pecl.php.net/bugs/bug.php?id=16966

At the bottom, you’ll find a few suggestions regarding your issue, as well as a fix for it which you can find in the latest SVN version. Hope that will help.

Cheers,

Frank

You may also try XCache.

@LaVerne:

Interesting that you experience such big differences between APC and eAccelerator. If i google for some benchmark comparison there’s not really much difference. Personally i’m using APC for a long time now and it never urged me to try something else. :) Sure APC was configured well? There are some options that make a real difference, with apc.stat being my favorite when it comes to top performance.

@adbie:

I’m running PHP 5.2.13 with APC 3.1.2 and never had issues with it.

@Mike:

I am sorry that the impression came up that eAccelerator is so much faster than APC - I didn’t actually mean it that way :)

I just was impressed about how well it worked out-of-the-box for me, and how much faster everything was delivered by the server than a standard server setup without any cache module.

Having read about a couple of benchmarks a while ago for the three most common PHP caches (APC / XCache / eAccelerator) since I am quite new to PHP, the consense of all reports was that they are quite equal in their performance. The final choice then is everybodys personal flavour, which in my case was eAcc.

But you are right, reading my post again, I quite emphasize eAccelerator over APC - please don’t ask me why :) So to correct my earlier statement:

@Everybody:

Take your personal best choice of the three mentioned caches, but take it, it’s worth it!

Cheers,

Frank

I got APC to work in a pretty stable manner after setting apc.shm_size to 128. No more "unable to allocate memory" errors for the past couple of days.

Thanks to all who responded.

Please forgive me for reopening old discussion, but I’m in this subject right now…

And what about information on CEAcceleratorCache page, saying:

Since you’re using eAccelerator 0.9.6.1 does it means, you don’t cache data, only variables/text/pages?