1

We want to install Varnish on our nodes that are handled by an Auto-Scaling Group and ELB. These servers currently grow and contract based on load from 2-10 nodes. We do not want to have another "master" varnish server due to cost implications.

Our optimal diagram would look like this:

           ELB
          / | \
Node 1 - Node 2 - Node 3, etc.
  |         |        |
Varnish  Varnish  Varnish
  |         |        |
Apache   Apache   Apache
  |         |        |
Centralized MySQL/File Servers

For further understanding, Varnish would be running on each of the Nodes as if all three are separate.

How do we keep all the Varnish's in-sync especially involving cache events (for example, someone updates a post on WordPress, and WordPress purges one of the Varnish caches but not the other 2). I would rather not add another dedicated Varnish server to oversee all of this. How do you normally handle the 3 varnish instances syncing across each other? Is there something I am not thinking of correctly or an alternative configuration?

David Eisen
  • 643
  • 5
  • 21

1 Answers1

0

usually we have some single admin server, with wordpress or magento running, they have special varnish plugin built into, it has all the logic, and sending commands to varnishadm on every server. or you can do the same from your workers, depends on your application.

           ELB
          / | \
Node 1 - Node 2 - Node 3, etc.
  |         |        |
Varnish  Varnish  Varnish
  |         |        |
Apache   Apache   Apache
  \         |        /
    Master Admin Node
   \        |       /
Centralized MySQL/File Servers
ADM
  • 1,373
  • 12
  • 16
  • Lets say theoretically I put the master admin node on one of the file servers, but do I need to make changes to every wordpress or magneto site running. We are a Private Shared host, with nearly a hundred sites. Are these code changes? If not, can you post an idea of what your config (or I suppose a script) looks like for this for the clients and the server? – David Eisen Aug 26 '14 at 19:12
  • google for: "wordpress purge multiple varnish servers", i guess you can easily create your own plugin/modification. – ADM Aug 26 '14 at 19:21
  • Wow ok, this seems extremely time consuming, and we would have to also make a plugin for other platforms we use. I understand the concept, I wonder if there is a way to have all varnish purge requests get forwarded at the operating system level to a master server, then replicated back to all the different hosts... – David Eisen Aug 26 '14 at 19:27