no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | varnish [2012/02/15 04:00] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== varnish ====== | ||
+ | |||
+ | Varnish is a web accelerator. | ||
+ | |||
+ | Wikipedia: A web accelerator is a proxy server that reduces web site access times. They can be a self-contained hardware appliance or installable software. | ||
+ | |||
+ | ==== Configuration ==== | ||
+ | |||
+ | Edit ''/ | ||
+ | < | ||
+ | backend default { | ||
+ | .host = " | ||
+ | .port = " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The web server must accept connections on that IP address and serve the content. | ||
+ | |||
+ | Start varnishd: | ||
+ | < | ||
+ | varnishd -f / | ||
+ | </ | ||
+ | |||
+ | ==== Notes ==== | ||
+ | |||
+ | * Varnish can have several backends defined and can you can even join several backends together into clusters of backends for load balancing purposes. | ||
+ | * Be aware that every object that is stored also carries overhead that is kept outside the actually storage area. So, even if you specify -s malloc,16G varnish might actually use double that. Varnish has a overhead of about 1k per object. So, if you have lots of small objects in your cache the overhead might be significant. | ||
+ | * You can use Varnish to cache content from different servers, effectively splitting URLs across many backends. | ||
+ | * Varnish has a "saint mode" where it will only send a cache if there is a bad request returnedV from the original webserver. | ||
+ | * Varnish can act as a high availability server, balancing load between two backends. | ||
+ | |||
+ | ==== Ubuntu ==== | ||
+ | |||
+ | < | ||
+ | curl http:// | ||
+ | echo "deb http:// | ||
+ | apt-get update | ||
+ | apt-get install varnish | ||
+ | </ | ||