5

We have 2 servers running Magento behind a load balancer. When content is changed in the admin area, Magento prompts us to flush the cache. If an admin user is connected to www1 and runs the cache flush, how do we set it up so the cache on www2 gets flushed as well? Has anyone dealt with this?

We're open to installing Memcached and using that with Magento, but from what I read, it sounds like it doesn't fully replace the filesystem cache so we'd still need a solution for this problem. Please correct me if this assumption is wrong, because I'd imagine switching to Memcached would solve this issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
weotch
  • 5,788
  • 6
  • 35
  • 42

2 Answers2

2

I would recommend setting up memcached or even varnish (seems to be the new craze) as both would simplify load balanced cache and session sharing issues your experiencing running both servers as file system.

To quote the magebase article (NOTE: the same applies to cache):

Memcached session storage takes a bit more setup than either of the previous two options, which is probably why it’s not considered a ‘normal’ option during Magento install. For starters you need a Memcached server running.

Once you have it up and running, the memcached session storage offers a number of benefits. Firstly it is very cluster friendly. The session data can be shared by any number of webnodes, and to make things even better you can easily add more memcached server nodes so that even your session storage can be scaled to handle many 1000′s of concurrent sessions*. Secondly, it is (or can be) separate of the database and web node entirely, which offloads the work of storing sessions from busy nodes in a high-traffic environment.

More details on choosing a session storage for Magento:

http://magebase.com/magento-tutorials/magento-session-storage-which-to-choose-and-why/

More details on setting up Varnish to work with Magento:

Getting Varnish To Work on Magento

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

The same problem. Memcached DOES NOT fully replace Magento cache storage. For "fast" cache it works perfect but for slow cache it doesn't. Which means that this way doesn't work for FPC (if you're running on Enterprise) - it's still stored in files. And there's no preference store FPC cache there. Varnish is not the case here - it's a kinda replacement for FPC.

Paul
  • 11
  • 1
  • Yeah, we are running enterprise. Have you come up with a solution? – weotch Aug 25 '11 at 14:58
  • You can use the database for slow cache instead of filesystem. Another option is to use an NFS share for the var/ path to allow the same files to be shared with multiple servers. Then when one server flushes cache, it will flush it for all servers. – Joe Constant Dec 06 '11 at 18:10