Setup Varnish 4 on CentOS 6 as a Caching Server and Load Balancer

Published March 29, 2015 • Updated May 3, 2017


In a previous post, I detailed how to setup Varnish 2.1.5 on CentOS 6 as a caching server and load balancer. After setting this up, I realized MP4 files were not streaming and large downloads were taking too long to begin.

Varnish 4 is the latest major release of Varnish and has provided fixes to all of these problems.

This post will be very similar to the previous post, but will provide the new VCL syntax that applies to Varnish 4.

Continue reading...

Setup Varnish 2.1.5 on CentOS 6 as a Caching Server and Load Balancer

Published March 28, 2015 • Updated May 3, 2017


Varnish is a highly regarded HTTP caching server. It sits in front of your web server tier and caches content in RAM so subsequent requests are served as quickly as possible.

Varnish can also be a basic load balancer. Combining a caching server and a load balancer works well when one or more of your web servers becomes unavailable. Because Varnish is also acting as the load balancer, no longer will the end user possibly see a “Service unavailable” message while the load balancer is removing the unhealthy web server from the load balanced pool; They will simply see a cached paged instead.

Continue reading...