0

I'm running Magento CE on multiple web node. The Admin Backend is always running on the same server, so all the images are uploaded on this server. On my

3 Answers3

1

The simplest method would be to use rsync with inotify on your admin server - so new images are distributed instantly around other nodes.

An application like http://code.google.com/p/lsyncd/ would work well and produce near-realtime replication.

You also have to bear in mind that on a cluster, you will have resized cached images generated on the fly, so it is also a good idea to rsync the

./media/catalog/product/cache

directory circularly between all nodes. This doesn't require inotify and can run on a lapsed ~10 minute cron.

This method will obviously become more and more inefficient the larger your media directory grows.

But if you have a BIG site

However, if your site is so large that it requires a cluster to begin with, it only seems sensible to be using a CDN for all media. Magento has a myriad of support for different CDN providers

Ben Lessani
  • 5,244
  • 17
  • 37
  • How does the CDN provider know from which web nodes it can load the resized image? Or do you know a Magento CDN push integration? – Tobias Feb 08 '14 at 15:44
  • It makes no difference really - as even on an origin pull basis, even if it hits a node without a cached image - the web node will generate it anyway. The important thing is that the media is present on all web nodes for the cache to be generated. – Ben Lessani Feb 08 '14 at 15:51
  • Unfortunately the cache files are only generated on the initial php request (resize method in views), the image request is just static and if the file does not exist outputs a 404 :( – Tobias Feb 10 '14 at 09:46
0

When it comes to cache files, one possible effective way is to use a NFS share volume and mount it on all the webservers. This way you can ensure the availability of cached files for all the webservers and even this helps if you want to purge any.

0

My best setup is to mount /var and /media via nfs on all webnides since no php will be executed (since the old php bug running over nfs) and then lsyncd rest of folders over to webnodes . This will ensure performance and media replication

x86fantini
  • 302
  • 1
  • 3
  • 9