Yes, I have read many close questions, but I needed a specific answer and hence this question.

First, these are my new server specifications: Linux Server (CentOS), Intel Xeon 3470 Quad Core (2.93GHz x 4) processor, 4 GB DDR3 Memory, 1TB Hard Disk Space, 10 TB Bandwidth and 9 Dedicated IPs.

AIM: To speed up my wordpress blog + Increase server's capacity to handle heavy load

PLAN: This is how I am planning to setup my server - - VARNISH (in the front, to cache server responses) >> NGINX (to effectively handle static content & overcome the C10k problem) >> APACHE (behind Nginx, to effectively deliver dynamic content) >> APC (PHP page, database & object caching) >> CPANEL (which requires Apache, and I require it) >> WORDPRESS >> W3 TOTAL CACHE (caching plugin for Wordpress).

So , will the setup work? Have anyone tried it? Please shower your thoughts and knowledge.

NOTE: I can't do without Apache because I am used to that .htaccess & Cpanel stuff. So, it's not any option. All others are options. Please try to help.

I hope I am clear in what I wanted to ask.


This looks like a classic case of premature optimization. Are you currently having capacity problems with Wordpress? I would start with a simpler setup of just Apache, APC, and Wordpress and see what you need. If you aren't hitting the C10K problem there is no need to solve it at this time. If you aren't serving a large amount of static content, you probably don't need to setup Varnish.

  • @slillibri I just want to make sure, my server doesn't go down due to traffic spikes. – user88753 Jun 25 '11 at 1:50
  • @slillibri Would this be a better idea? Nginx, Apache, APC & Wordpress, and then a CDN to serve the static files (instead of Varnish). Howz that? – user88753 Jun 25 '11 at 1:52
  • @Aahan Still a bit of premature optimization. Setup the basics and do some load testing with ab or httperf or Tsung. Before you have some numbers I would stick to a simple, easy to debug setup. It takes a minute to get a CDN setup for your site, and even then it's more to speed delivery of static assets globally. – slillibri Jun 25 '11 at 2:09
  • @slillibri Thanks for your suggestion. Yes, I am starting to consider them now. – user88753 Jun 25 '11 at 3:16
  • @slillibri Finally I have decided upon this: VARNISH in front of APACHE + WORDPRESS + CDN. 1. Since I am using Varnish, I don't need a cache plugin for wordpress, like W3 Total Cache right? 2. And since I will be using a CDN it reduces the need for Nginx / Cherokee or whatever, right? Please shower your thoughts about this setup. – user88753 Jun 25 '11 at 16:16

You don't need NGINX to do the static content. Varnish solves the C10K problem as well. So you can just do varnish -> apache w/ mod_php and APC

W3TC configured to use APC for PHP object and Database cache will work fine.

You should also setup W3TC to offload static content (js, css, images, media) to a subdomain, and then consider making that subdomain a CNAME to a CDN instead of just a second hostname pointing to Varnish.

Varnish cache, and W3TC cache are different, W3TC can cache database queries, and stuff like that, sub-parts of the page, whereas Varnish is caching the entire object (page, image). So you still want W3TC. Varnish won't cache anything with cookies, so make sure you strip cookies on images/js/css (except captchas, etc).

  • I need some clarification about the last point. — As far as I know, W3 Total Cache caches Pages, objects and database; furthermore, it minifies HTML, CSS and JS; enables browser cache and adds necessary headers — And then, you said "whereas Varnish is caching the entire object (page, image)" — Can you please clarify what exactly Varnish caches? It caches pages, serves static content (images, JS, CSS etc) quickly... is that right? And what does does it do? – user88753 Jun 26 '11 at 4:49
  • W3TC is very configurable. You can tell it specifically what to do, what not to do. e.g. I use mod_pagespeed, so I tell W3TC not to minify or compress. W3TC has a section where you can set up its interaction with Varnish! Let me know how you get along as I am considering a similar stack. – OC2PS Oct 30 '12 at 6:49

Your Answer

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