• http://maxolasersquad.com/ Maxolasersquad

    Out of curiosity, why are you using PHP instead of Ruby or Python?

    • http://danielmiessler.com/ Daniel Miessler

      WordPress is PHP. .

  • Darren

    Excuse me if I missed it, but how are you invalidating the varnish cache? Does W3-Total-Cache do that?

    • http://danielmiessler.com/ Daniel Miessler

      I don’t understand the question.

  • Darren

    You say “made it so that when we create or update a WordPress post it’ll refresh the Varnish cache appropriately so we don’t have a stale site while waiting for expiration.”, and you do have the VCL to handle a PURGE request, but what issues it?

    • http://danielmiessler.com/ Daniel Miessler

      Ah, yes, the caching plugin has the option to purge it. You just need the varnish config to allow it.

      • Darren

        Got ya, thanks. I did have a flip through the plugin documentation but couldn’t see anything mentioned about it – I’ll install it and take a look :)

  • Pingback: Optimizing WordPress with Nginx, Varnish, W3 Total Cache, Amazon S3, and Memcached (With Benchmarks) - webguo在路上

  • http://profiles.google.com/unsalkorkmaz Ünsal Korkmaz

    You said “I also do some mysql optimization, but it’s nothing special: I just enable caching with the same config that’s found all over the Internet.” I still would like to see your config if possible :P

  • http://profiles.google.com/unsalkorkmaz Ünsal Korkmaz

    You said “I also do some mysql optimization, but it’s nothing special: I just enable caching with the same config that’s found all over the Internet.” I still would like to see your config if possible :P

  • http://twitter.com/AntonioRomero Antonio Romero

    Hello Daniel,

    how do you set up the expiration time of images in the CDN with W3 Total Cache? http://www.labnol.org/internet/lower-amazon-s3-bill-improve-website-loading-time/5193/

    I am using APC OPCode and have enabled Database Cache, should I keep it enabled or should I disable it? Your #W3-Total-Cache point 4., only applies to memcache?

    Thanks a lot for your article!

  • Pingback: Amazon S3 Plugin vs W3 Total Cache | Netvivs

  • http://softwarebuzzer.com sureshpeters @software buzzer

    these are my proven tips at my blog :) http://softwarebuzzer.com/2011/04/optimize-wordpress-faster-loading-timeproven-tips/ and i never tried varnish at all ? is there any plugin?

  • Dario

    Hi, seems you cannot use analytics, what about ads?

    Dario

  • Andy Morris

    just curious… do you use a panel at all? does not installing varnish and nginx generally screw with your web hosting panel and vice versa? i still need a hosting panel but it seems people are having problems

    • Rauh Georg

      I went over that site a few times in the last day on my epic quest for the best PHP cache, accelerator, alternative web server etc.

      Here is an interesting bit i picked off several blogs: The gain from installing Nginx on top of Apache is supposedly very, very minimal. I also did AB testing and benches with all kinds of W3 Total Cache configs, APC, eaccelerator etc.

      The problem is that ALL of them are a pain to install on a Cpanel/WHM server…APC for example simply wouldnt want to cache. Short: Also with tweaking of W3Total Cache which i religiously use i did NOT see any changes in apache bench.

      The BIG success came when i installed Varnish (with the varnish cpanel plugin). Not only did this finally install and WORK (unlike all the other things i tried)….the speed is BIZARRRE ridiculous now.

      No matter what i did before, APC, Nginx, eaccelerator, W3 Cache tweaks, on one of my typical WP blogs i got barely below 500ms with 7+ threads literally already killing my server.

      With varnish cpanel plugin this is now down to 2.8- 4ms (!). Its not even in the same ball park. It’s just amazing. Forget litespeed, nginx etc..you dont need it.

      • http://danielmiessler.com/ Daniel Miessler

        So you want to be using Pingdom to watch your page load times from around the world. Then add CloudFlare to the mix and watch your worldwide times hit bottom. Check it:

        http://danielmiessler.com/blog/wordpress-optimization-results-varnishnginxapc-w3-total-cache-amazon-s3-cloudflare

        • http://www.1up-seo.com Rauh Georg

          I just got MaxCDN as a CDN, really cheap ($29 for 1 TB).

          Current config: Varnish Cpanel Plugin/Apache/MySQL optimizations (with MySQL Tuner)/MaxCDN/W3 Total Cache. W3TotalCache still awesome, especially how simple it is to integrate with MaxCDN.

        • Anonymous

          Or you could use google analytics to track page load speed with

          _gaq.push(['_trackPageLoadTime']);

    • http://www.1up-seo.com Rauh Georg

      yes “people have problems”…this is certainly true looking at some of the APC install scripts. One was literally killing my server by writing some wrong values into php.ini which prevented my apache to start.

      NOT SO with Varnish Cpanel plugin, that’s why i like it too. There is a cpanel/directadmin version. I use the cpanel version, was very easy to install. And as i said above, according to some other bloggers the benefit of plopping an additional Nginx on top of Apache is supposedly minimal…

  • http://www.1up-seo.com Rauh Georg

    whichloadsfaster.com needs 800ms(!) to load google.com, 2100(!!)ms to load apple.com and 6390 (!!) ms to load adobe.com. I don’t think this can be taken serious for benchmarking web sits.

    • http://danielmiessler.com/ Daniel Miessler

      That’s your computer and bandwidth being slow. It tests how fast the pages load for YOU.

      • http://www.1up-seo.com Rauh Georg

        Daniel, my computer is a 3.6 Ghz Quad, not the newest tho, and a “reasonable” fast internet 10MB/s here in spain. Adobe would not need 6.3 seconds to load even if i were on dialup :) I think there are better ways to test site loading speed…i just dont trust that site since the values shown are already totally off to begin with.

        • Guest

          I believe you don’t remember dialup connections

        • Meow

          What kind of chip do you have in there? A dorito?

  • http://twitter.com/titanas Stefanos Kofopoulos

    Great post Daniel. I was wondering, what happends with WordPress permalinks, the nice ones (instead of /?p=5 something like /optimizing-wordpress ). I think nice permalinks are killed. Another thing is the user already commented in the blog, will they see their data (nick name / email / website) filled in or they have to manually entry all the data again?

  • http://www.dedy.us Dedy

    Hi.. I try to use varnish but the server is sometimes not respond what different varnis & nginx??

    Thanks

  • Anonymous

    php-fpm or php5-fpm doesnt seem to be available through aptitude on an Ubuntu 10.4 LTS 64bit system. I used Brian Mercers PPA to install it, but then that just added more problems because when i tried to install php-apc, it wanted to install apache.

    Also, in your instructions, you forgot to mention the path for the varnish config. It was easy to find, but at least mention the filename would have made your instructions a little more complete.

    Any ideas the first issue? Was hoping to find a working and complete tutorial so that it left less changes of me screwing something up as this would be the first time i have worked with varnish and i wouldnt consider myself a nginx expert.

    • Anonymous

      Nevermind, most of the instructions work for Ubuntu 11.04, but unfortunately I still dont have php working. Its installed and im not getting any errors, but they simply dont execute. Its as if the server doesnt even see them.

  • Pingback: Fighting Back After Hacker News Took Down My Site » Techspeak

  • http://www.connectedinternet.co.uk/ Everton Blair

    what browser cache settings do you have for W3TC? I’m having problems with varnish where my homepage isn’t updating, and I think it’s because I can’t set a high max-age if I’m using varnish as well.

  • Pingback: Usando Varnish como proxy [WordPress + Apache]

  • Dspread

    Is anyone using Varnish with OpenVZ? Every single thing I have read says that because of the way Openvz handles RAM, Varnish will eventually eat up all the RAM. Was curious if anyone had any experience with VPS’s. Is it still XEN or nothing for Varnish users?

    • Dspread

      also have read a lot about memcache vs apc and apc is FASTER than memcache on a local server. obviously apc cant be distributed across multiple instances but on a local server, apc much faster than memcache

  • Pingback: Optimize WordPress with Nginx, Varnish, APC, W3 Total Cache, and Amazon S3 | Nginx Lighttpd Tutorial

  • VARNISHTERMINATED

    Unterminated string at (input Line 44 Pos 19) if (req.url ~ “^/[^?]+.(jpeg|jpg|png|gif|ico|js|css|txt|gz|

  • VARNISHTERMINATED

    I thank you for this post. It helped me a lot. However, HTTP accelerator fails during reboot. I even tried service varnish stop; service varnish start….

    I have been searching online to fix this issue…

    I got this error… /var/lib/varnish/melody# service varnish start * Starting HTTP accelerator [fail] storage_file: filename: /var/lib/varnish/melody/varnish_storage.bin size 1024 MB. Message from VCC-compiler: Unterminated string at (input Line 44 Pos 19) if (req.url ~ “^/[^?]+.(jpeg|jpg|png|gif|ico|js|css|txt|gz| ——————############################################# Running VCC-compiler failed, exit 1 VCL compilation failed

    ?

  • Anonymous

    Your VCL might be missing some advanced functionality, here is an updated WordPress Varnish VCL for you

  • Manish Singh

    Your last test is Failed !!!

    Failed requests: 992 (Connect: 0, Receive: 0, Length: 992, Exceptions: 0)

  • http://twitter.com/JordanMG Jordan

    Could you expand on the reason you’re not using database caching with W3TC?

  • http://twitter.com/JordanMG Jordan

    Could you expand on the reason you’re not using database caching with W3TC?

  • Pingback: 优化wordpress,提升访问速度 | Fang Jian's Personal Blog

  • Anonymous

    nice work

  • Pingback: Wordpress Performance Tips » Sneek-A-Peek

  • Pingback: Bookmarks for 17 nov 2011 from 23:06 to 23:56 | jtheo

  • http://b-ds.fr/ Benjamin Dos Santos

    You have 992 failed requests in last Benchmark. Mistake ?

  • http://anishkothari.posterous.com Anish Kothari

    Thanks for the guide! One edit -> the command to install PHP FPM on ubuntu 11 is: apt-get install php5-fpm

  • ashraf amayreh

    I’ve read so many posts now regarding this. But in your above configuration you do not turn on nginx’s native caching. You may want to try out nginx’s built-in reverse proxy caching and you may no longer need varnish. Check out this article:

    http://zenginx.com/2010/05/17/php-fpm-cache-nginx-on-steroids/

    Would love to hear your view on this if you decide to try it out.

  • Pingback: webguo在路上 » Optimizing WordPress with Nginx, Varnish, W3 Total Cache, Amazon S3, and Memcached (With Benchmarks)

  • Pingback: How much (cache) is too much? | Gingerlime

  • Pingback: Installing wordpress nginx varnish | wikirouters.com


Top

Popular

Information Security / Technology

Politics

Philosophy & Religion

Technology & Science

Culture & Society

Miscellaneous

Arguments

Projects

Collections

Twitter

What I'm Reading

Favorite Books and Essays

Top Blog Categories

Inputs