Tuesday, April 3, 2012

Yum Install Varnish Cache

How to yum install on RHEL/CentOS/Fedora? Here's how.

# rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm

# yum install varnish

Then start,

# /etc/init.d/varnish start or,

# service varnish start

To configure, this must happen prior to starting, edit the VCL file

# vi /etc/varnish/default.vcl

What is Varnish?

The Basics

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture. A high level overview of what Varnish does can be seen in the video attached to this web page.


Varnish performs really, really well. It is usually bound by the speed of the network, effectively turning performance into a non-issue. We've seen Varnish delivering 20 Gbps on regular off-the-shelf hardware.


One of the key features of Varnish Cache, in addition to its performance, is the flexibility of its configuration language, VCL. VCL enables you to write policies on how incoming requests should be handled. In such a policy you can decide what content you want to serve, from where you want to get the content and how the request or response should be altered. You can read more about this in our tutorial.

More about it here

Why Use Varnish?

You can use varnish as front-end full page caching mechanism very much similar to how CDN is used. It has VCL which is very much similar and more robust than AKAMAI's ACO Rules. If you have the infrastructure to maintain your own edge servers, this can be the software for your very own CDN or if you simply want to cache request to your application servers and improve its performance, this is also for you. Good Luck!

  • Related Links Widget for Blogspot

No comments: