Varnish

Varnish is a web application accelerator also known as a caching HTTP reverse proxy. It’s an alternative to squid, the web caching service that the ATLAS community is familiar with. Slate recently released two Varnish charts, v4a and v4cvmfs. The former creates a Varnish instance that is configured to proxy ATLAS Frontier requests while the latter creates a Varnish instance that is configured to proxy CVMFS requests (CMS, ATLAS, and any CVMFS repository available on Stratum One servers).

In this blog post, we will introduce Varnish, it’s current deployment status at SLATE sites, and show side by side comparisons of Varnish and Squid.

Varnish Overview

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 this video.

Varnish vs Squid

Squid and Varnish are both open source tools. Varnish with 908 GitHub stars and 216 forks on GitHub appears to be more popular than Squid with 560 GitHub stars and 202 GitHub forks. We use open source version of Varnish that lacks persistent storage and range requests. For most usecases this is completely sufficient as even caching in only 2GB of RAM still gives >99.5% cache hit rate.

varnish vs squid in popularity

SquidVarnish
A caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. Squid reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL; High-performance HTTP accelerator. 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.

Deployment Status

Currently, Varnish is deployed at AGLT2 and MWT2.

  • AGLT2: Two instances were deployed as primary frontier caches in summer 2022. Since then there was no issues observed with the instances.
  • MWT2: Recently deployed both a v4a and a v4cvmfs instances, serving all three sub-sites (UC, IU, UIUC) and Analysis Facility.

Monitoring

Varnish is monitored in both Elasticsearch and ATLAS MRTG monitoring like squid does. Reports request/fetch, in/out data rate, CPU usage, objects and file descriptors.

Varnish and Squid instance SNMP monitoring

Varnish and Squid metrics

Varnish and Squid monitoring in Elasticsearch

Varnish and squid in ES

Performance Test Results

CVMFS

We used Siege to replay 100k requests with concurrency of 30. Varnish is six times faster serving Frontier requests and much more when serving CVMFS files!

SquidVarnish
Transactions:             	101391 hits
Availability:             	100.00 %
Elapsed time:             	235.63 secs
Data transferred:        	7059.98 MB
Response time:              	0.05 secs
Transaction rate:         	430.30 trans/sec
Throughput:                	29.96 MB/sec
Concurrency:               	22.02
Successful transactions:   	93525
Failed transactions:           	0
Longest transaction:        	3.37
Shortest transaction:       	0.03
Transactions:             	101391 hits
Availability:             	100.00 %
Elapsed time:              	42.66 secs
Data transferred:        	6894.09 MB
Response time:              	0.01 secs
Transaction rate:        	2376.72 trans/sec
Throughput:               	161.61 MB/sec
Concurrency:               	16.04
Successful transactions:   	96796
Failed transactions:           	0
Longest transaction:        	4.01
Shortest transaction:       	0.00

Frontier

SquidVarnish
Transactions:                 177595 hits
Availability:                  99.96 %
Elapsed time:                1612.89 secs
Data transferred:            1232.78 MB
Response time:                  0.26 secs
Transaction rate:             110.11 trans/sec
Throughput:                     0.76 MB/sec
Concurrency:                   28.34
Successful transactions:      177595
Failed transactions:              75
Longest transaction:           24.38
Shortest transaction:           0.21
Transactions:                 177602 hits
Availability:                  99.96 %
Elapsed time:                  37.07 secs
Data transferred:            1232.79 MB
Response time:                  0.00 secs
Transaction rate:            4790.99 trans/sec
Throughput:                    33.26 MB/sec
Concurrency:                   16.55
Successful transactions:      177602
Failed transactions:              68
Longest transaction:            4.97
Shortest transaction:           0.00

Summary

We showed in this post that Varnish is faster, needs less resources, and it is easy to monitor. It’s a step forward toward efficiently caching Physics data over HTTP. Please refer to the chart repo on how to make deployments, and we encourage you to try this out and let us know if you have any feedback or suggestions that would help us improve this chart and make it more beneficial to users. For discussion, news and troubleshooting, the SLATE Slack workspace is the best place to reach us!

The SLATE Team