WordPress and PHP: A Match Made in Heaven

In: Computers|Linux Tips|Performance

7 Dec 2008

I enabled APC, the Alternative PHP Cache, a while back. The basic premise is that it’s an opcode cacher, making up for the fact that PHP pages get compiled on each pageload. It also caches oft-used files, though. (Although, in theory, Linux ought to be caching oft-used files in RAM too, APC is a bit more specific in forcing this behavior.)

WordPress is a huge application, with dozens of files being used on each pageload. And this is where APC shines: those files end up in the front of the cache, ensuring we never hit disk for a pageload. The APC dashboard shows that I tend to sit at about a 99% hitrate, which is obviously a good number. It could probably go higher, but for the fact that I’ve only allotted it 16MB to work with, which means that it periodically has to jettison items from the cache. This is a big flashing neon sign saying I should increase the limit, but in my 512MB VPS, I have a lot of things trying to lock onto their 16 and 32 MB chunks of RAM, and performance with a too-small cache is still superb. I’m RAM-frugal.

But really, if you’re running WordPress (or much of anything in PHP, really), you should give APC a look. It’s simple and it’s a ginormous speedup.

Related posts:

  1. WordPress 3.0
  2. Stomatron
  3. WPMU and APC Error
  4. An Image Idea
  5. Memory Fragmentation

Comment Form

On Other Sites

  • Matt: Hey Victor, A couple good resources for you... http://www.scanboston.com/boston.htm is really det [...]
  • victor: Hi i just got a uniden bearcay scanner and have no local or regional frequency directory.just 1 460 [...]
  • Matt: I do use them periodically. I bought a few i760's, for perhaps $10 apiece in a lot, on eBay a while [...]
  • Marin: Did you eventually end up going with an iDEN phones using Direct Talk? I had some i560's a few year [...]
  • Dan: fyi, EOD = explosive ordnance disposal [...]