0

We are migrating many sites from various content management systems onto a single Drupal/Aegir platform. We used to have a high density of sites on the same servers and Aegir definitely makes managing high density Drupal sites easier. Unfortunately having the same density of Drupal sites on scaled up hardware is leaving us with slower response times for the same amount of traffic. The platform/codebase is itself a bit of a beast, with some sites having 250+ modules enabled and response times stretching to 30+ seconds with Drupal caching disabled. The shared codebase acts as a sort of menu for business divisions to be able to choose features/themes from. With APC, Drupal cache and memcached running we still struggle on ocassion.

I think it makes sense to look at building up a caching layer in front of Apache-Drupal-Aegir before we start scaling the application layer horizontally. Aegir brings a big benefit to managing multiple sites and ending up with multiple Aegir instances takes away some of that benefit. In particular I like the idea of being able to cache some/all of the dynamic content for anonymous users in case the Aegir server is unavailable for any reason.

The options as I see it are:

  • Drupal boost module. Probably the easiest to setup but unfortunately does not appear to work with Aegir without some manual patching.

  • nginx as a reverse caching proxy. SSL support, easier to configure

  • Varnish as a reverse caching proxy. No SSL support, more difficult to configure

  • Ditch Apache and run Aegir on nginx/PHP-FPM. I prefer running Aegir on Apache at this stage as it will be easier for other engineers to troubleshoot.

We also have an HAProxy installation which load balances (actually failover/fault tolerance) for other applications, so we could always terminate the SSL at HAProxy and failover across multiple nginx or Varnish instances, with a single Drupal application server at the back. Though that means requests jumping through 3 layers to potentially hit the back-end, which doesn't sound too great.

Questions:

  1. I'm tending to go for nginx as the reverse caching proxy because of simple configuration and management by other users and a single entry point for SSL management.
    Is there any reason why I should choose Varnish instead?

  2. Is nginx able to serve cached "dynamic" content to anonymous users in the eventuality of the back-end Drupal server being down?
    Or is it purely restricted to static content such as images, JS, CSS etc?

  3. What about having HAProxy on top of that, so we can failover between multiple nginx instances?
    Or is it insane to have requests potentially going through 3 layers of proxy to reach the Apache/Drupal back-end?

1
  1. Use what your comfortable with for maintenance and configuration.

  2. Probably, depending on config. (I don't use nginx)

  3. Not crazy, it allows for a very quick switch time to another webserver.

I have varnish combined on my webservers with a separate apache reverseproxy doing ssl termination.

A little custom hook triggers a reverse proxy update on a Aegir migrate task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.