

Tell HN: Have a look at Varnish - eisokant

Hey Everyone!<p>I just wanted to share with you the link to an incredible HTTP accelerator: http://varnish-cache.org/<p>We've been testing a lot of different stacks for our startup (Tyba) and using NGINX (behind) + Varnish (upfront) has allowed us to go from 9 reqs/sec (loading a Wordpress site) to 2500 reqs/sec.<p>I know it's not a novelty but I wanted to share it in the hope it helps the few people who don't know about it.<p>Kind regards,<p>Eiso
======
zepolen
Why would Varnish be required in that situation if you're already running
nginx which is perfectly capable of caching a simple wordpress site in the
same manner.

~~~
StavrosK
I don't think it's required, but, really, why wouldn't you be running varnish?
It's just amazing.

~~~
piotrSikora
Because it doesn't add anything useful to the mix - nginx's cache works just
fine.

~~~
mrkurt
Sure it does, it adds ESI (which is fantastic). It also keeps backend
connections open rather can creating/destroying them for each request. Varnish
does restarts nicely too, we have requests that get passed on to another group
of servers if the backend returns errors. It's really a very nice way of
brokering http requests.

~~~
zepolen
I think the point is 'in this situation'. Of course there are places where
Varnish's features are useful, just not here.

------
d_r
More context on why Varnish is superior to Squid: <http://varnish-
cache.org/wiki/ArchitectNotes>

~~~
sgt
Varnish = reverse proxy Squid = forwarding proxy

~~~
ggbaker
Squid can also be used as a reverse proxy, so it is a reasonable competitor to
Varnish. (As is Apache mod_proxy.)

------
jacquesm
Agreed, varnish is awesome, we use it on a home-brew CDN and it has been a
fantastic experience so far.

Also, the guy that wrote it (Poul Henning-Kamp) is very responsive when it
comes to answering questions or fixing issues, they have an IRC channel at
#varnish on irc.linpro.no.

Definitely a piece of software worth looking in to when your website gets
bigger.

~~~
Andys
PHK has a history of smash hits; he is responsible for much of the work on
FreeBSD's container-based virtualisation (jails), modular disk device
framework (Geom), & disk encryption (gbde).

------
DavidPP
For people who want to use NGINX caching on top of Apache/Wordpress, I found
out this tutorial : [http://www.myatus.co.uk/2010/06/28/a-simplified-nginx-
apache...](http://www.myatus.co.uk/2010/06/28/a-simplified-nginx-apache-combo-
with-wordpress-support/)

------
japanesejay
Thanks for sharing! We've built a drupal powered site using Varnish as well.
With a few tweaks, our initial tests showed ~3000 req/sec! Good stuff!

------
jessor
Agreed, nginx+varnish (optionally on top of an existing apache setup) seems to
be best practice right now for heavy traffic sites.

~~~
piotrSikora
This might be most popular setup right now, but I wouldn't consider it the
best practice. Why in the world would you use both nginx _and_ varnish?

~~~
zepolen
Because until 0.7 nginx lacked a caching system, and so it made sense to use
both. Now it doesn't.

~~~
bjpirt
And even now there's no way of manually expiring a cached page without using a
third party unsupported plugin (IIRC)

I still love Nginx though :-)

~~~
piotrSikora
I'm the author of ngx_cache_purge [1]. Would you mind explaining why do you
think that it's "unsupported"? This module is fully maintained, it works with
every recent nginx release and supports purging content from cache of every
upstream supported by nginx (FastCGI, proxy, SCGI, uWSGI).

[1] <http://labs.frickle.com/nginx_ngx_cache_purge/>

