I have read some articles about it, but i still dont get some things.

  1. Isnt Varnish and Nginx basically the same thing? I know varnish is not a web server but Nginx in this case is not used as one neither, they both act as a reverse caching proxy.

  2. Will APC even work in this configuration?

What do you recommend to speed up a Wordpress blog?

6 Answers 6


Start off with PHP-APC. That's a good start for any site. Override the cache size, and give it like 128M to play with.

Install Memcached, and use that for caching query results.

Install Wordpress's W3 Total Cache plugin, and turn everything on.

Get an Amazon S3 instance with Cloudfront, and configure it as the CDN for your wordpress site.

Configure Varnish as a reverse proxy for your Apache, but remember you'll have to pass any requests containing a wordpress login cookie, or you'll end up with an Identity Crisis, where everyone is served logged-in user content.

That's it. That's all there really is to it. It's actually deceptively complicated, but those are the basic main steps.

  • But still, wouldnt it be better if i used the following? Internet -> Varnish -> Nginx -> Apache
    – Jim
    Commented Jul 26, 2011 at 15:30
  • Why? Varnish can be more than just a caching reverse proxy, it can do load balancing with the director { } configuration block. What are you trying to achieve by having nginx in the mix too? Another point of failure? Commented Jul 26, 2011 at 15:43
  1. Varnish is designed from ground-up to be a very fast and scalable web cache solution. Nginx is designed from the ground up to be a very fast, modular and small web server for static content.

  2. APC is a PHP caching mechanism, you don't run it on nginx, varnish or any other cache/front-end server, you run it on the application server (mod_php, php-fpm etc).

I've not encountered anyone who deploy Varnish and APC at the same time, as it doesnt really help you. Varnish caches the dynamic pages (for example PHP) until you tell it not to.

The trend these days are to design high-performance websites like this:

Load balancers -> Frontends -> Backends (Application servers) -> Databaseservers
                            \- File servers
  • Ok, this answers the number 2. Thanks :)
    – Jim
    Commented Jul 26, 2011 at 15:16
  • Let me edit and answer what I know about the first part then :P
    – pauska
    Commented Jul 26, 2011 at 15:19

I personally use Internet -> nginx -> Varnish -> Apache simply because I don't want to store images directly in Varnish cache.

I have a couple of blog posts with sample configuration available at - http://syslog.tv if you're interested.


Varnish; Apache -or- Nginx; APC/Memcached -or- APC/PHP-FPM.

  • Varnish caches/serves static content
  • Apache/Nginx handles HTTP requests for non-static content
  • APC/Memcached / APC/PHP-FPM caches pre-compiled PHP objects

Loadbalancing can be handled at various points


What do you recommend to speed up a Wordpress blog?

I'm not that familiar with WP but don't most people start with WP Super Cache?

  • Im not starting. Im using W3 Total Cache with APC on the server side. But now im buying a new server so want to setup everything from scratch. And i really liked the benchmarks of this setup.
    – Jim
    Commented Jul 26, 2011 at 15:14
  • W3 Total Cache > * Commented Jul 26, 2011 at 15:21

I run multiple blogs and was having performance issues on EC2 servers so I did the following:

Ubuntu 11.04 -> Varnish -> Apache 2 -> Wordpress Multisite + Domain Mapping Plugin

I run multiple blogs on an EC2 Micro instance. I tested it with loadimpact.com and it will easily serve 50 concurrent users with multiple requests and no CPU steal problems.

Under this load the CPU is sitting at 0.02% load and the disks are doing nothing.

All you need is Varnish at the front with a good wordpress vcl, it is amazing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .