Varnish with Apache or NginX & php-fpm

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Anonymous's picture

I "think" I managed to get php-fpm working reasonably well with my Centos apache server. Running memcached and apc with 2GB of RAM on a VPS.

I am now planning to tackle Varnish. My question is should I be running Nginx for the varnish "static" anon content and/or the entire Drupal 7 site?

Looking around the web, there appear to be many examples of deploying Varnish with Nginx, not so much with apache?

Comments

Varnish works great with Apache/everything

tloudon's picture

I realize this is a few weeks old, but I wanted to mention that the majority of sites that I have seen with Varnish use Apache (I am not saying either web server is "better"--just that Apache usage is not in decline or the minority in my experience). I just set up a client with Varnish and Apache the other week (if you are curious, Apache was a better fit for the sys ops team/organization than Nginx; ie, the decision was cultural and not technical in nature).

I have seen successful sites using Varnish+Apache and successful sites using Varnish+Nginx. I think it's about what works for your team, skills, infrastructure--either web server is fine. If you already have Apache working, I would just add Varnish in front of it and not worry about Nginx.

Varnish is super flexible because it's totally decoupled from the backend--you specify the port and how you want to handle cookies/URL patterns/HTTP Headers/etc. At various times, I have had Varnish caching with Apache, Nginx, Ruby Rack (Sinatra); along side Nginx (SSL termination); and passing through to Nginx+Unicorn (Rails) and Apache+Passenger (Rails).

The standard Drupal VCL should work fine w/ Apache. See 4K's https://fourkitchens.atlassian.net/wiki/display/TECH/Configure+Varnish+3... and Lullabot's http://www.lullabot.com/blog/article/configuring-varnish-high-availabili... (VCL link is in the article). Also, if you are concerned about gotchas w/ Varnish--I wrote a mini-book on it. It's available here under the CC BY, http://loudonco.com/blog/drupal-varnish-mini-book

Cheers

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week