0

I am currently combing through the Magento Performance White paper to optimize our Magento experience before the start of the holiday season. For 2 months we get heavy traffic spikes and want to make sure we are running smoothly. We are using Magento EE 1.8 and by default utilizing Full Page Cache. In addition to FPC I have enabled GZIP, Cache-Control headers, and made all the mySQL tuning adjustments recommended by the white paper. We will also be employing a CDN to serve static content.

We are currently using filesystem cache and I am confused on where APC would fall into this stack, if at all. Is it worth installing APC when we are using FPC already? I know that the Magento cache and APC cache are 2 different things so if I edit products which invalidate the Magento cache and need a refresh, do I in turn have to refresh the APC cache each time? Any help is appreciated!

jkphl
  • 181
  • 8
  • 21
  • its a php cache, compiles the code and stores in ram, as well have optional variable cache – Andrew Jul 20 '12 at 20:21
  • Yeah Im just trying to figure out how it would work in times when I need to refresh it. We do a lot of product editing during shopping hours and have to refresh the FPC a decent amount. So after I refresh the FPC, I would need to refresh the APC correct? – jkphl Jul 20 '12 at 20:51

2 Answers2

2

APC is opcode cache geared towards PHP itself, FPC is more geared towards caching of content geared towards Magento itself. You should not need to refresh APC when making any product changes. Only FPC will need to be refreshed upon a backend type of edit, Magento will normally notify you about it being invaldated. APC will only need to be refreshed if a PHP or template (.phtml) file has been modified or changed. Keep in mind that APC stores cache for both CLI and Web based differently so employing some type of wget or cURL request to a custom internal URL that will clear the cache is best.

For example something like

system('wget --spider --quiet http://localhost/apc/clear_apc_cache.php');

Also, I'd highly recommend setting Varnish reverse proxy server in front of the stack as its performance is highly noticable on high traffic systems. You can also use memcache to keep database loads on checkout or dynamic requests outside of Varnish or FPC.

Getting Varnish To Work on Magento

Hope this helps!

Community
  • 1
  • 1
B00MER
  • 5,471
  • 1
  • 24
  • 41
1

You could use APC for your 2 level caching (see _getBackendOptions() in Mage_Core_Model_Cache). Though APC isn't the best option for that.

Depending on whether you run a single or multiple webnodes you could either choose for memcache (multiple webnodes) or tempfs (single webnode). With memcache configured in Magento you can still use APC to cache opcodes.

After editing a product you only need to hit the 'flush cache storage' in the cache management admin to invalidate all entries in memcache. APC doesn't need any flushing.

Where are you currently storing your sessions? If it's also on disk, you might also want to migrate them to tempfs or memcache. Though, be cautious when using memcache: use a different port/pool for your sessions than the one that is used for FPC. Otherwise you would flush all sessions when flushing memcache, logging out all users and flushing their carts in the progress.

Tim Hofman
  • 1,068
  • 7
  • 10