Varnish : an introduction

Kacper Wysocki

Infrastructure Consultant

High Performance Scaling Expert

Security Specialist

Kick-ass snowboarder

problems solved

Some problems are easy to solve

with varnish.

.

throughput

peak periods and scalability

latency

minimal round-trip latency

availability

protects frontend from

maintenance windows and

outages.

DDoS attacks

varnish takes the load,

without breaking a sweat

dampening attack on appservers

mobile detection

detect-and-redirect or simply serve a different site

realtime monitoring

realtime http-level control and transparency

unified brand impression

simplify multi-domain site routing,

rewrites and redirects

How does Varnish do it?

modern code

(for modern architectures)

written for 64-bit OS

demand-driven design

features solve

real-world problems

only

super-threaded

shared-nothing work delegation

can handle

100K requests

** per second**

fast critical path

request must be delivered

with minimal effort

real-time insights

shared memory log and

for metering,

monitoring

and troubleshooting

extensible configuration

Varnish Configuration Language

powerful yet simple

Typical Deployment Scenarios

Varnish as a loadbalancer

data/var1.svg

Varnish behind the loadbalancer

data/var2.svg

Varnish on the appserver

data/var3.svg

Redundancy

Deploy 2 or more Varnish servers

for high availability

Deployment Requirements

When you deploy Varnish,

what do you need to do?

Typical time to deploy:

3 working days

Decisions:

  • Subscription level

  • Frontend

recommended scenario #1: varnish as load balancer

Responsibilites

We need these things before deployment:

  • system overview

  • frontend domain names

  • backend hostnames, ip, port numbers

  • DNS / load balancer config

  • host(s) to deploy Varnish on

Typical Deployment

what to do, when, how. next step?

Day 1

installation and configuration

Varnish installed on hosts.

Initial VCL set up.

Day 2:

preprod Quality Assurance.

Production Deployment

Day 3:

post-prod QA

VAC install

Day 4 (offsite):

Cache tuning

spillover from day 3

Subscriptions

Varnish Administration Console

data/vac.png

Support

Access to highly qualified Varnish consultants.

Device detection

What mobile device is connected?

Paywall

check whether reader has access to page he is requesting

before Varnish delivers it.

Training

for developers and system administrators

Custom Statistics Daemon

Real-time aggregated stats from varnish cluster

Custom Stats

Here are some examples of the type of statistics you may track:

The URLs that take the longest time to load

URLs that get most hits

URLs that get the most 50x response code errors

Cache hits and cache misses

Products that are attracting the most traffic

Where traffic is coming from

Clients that are generating load on various parts of the system and where are they located.

Things to bring home

how simple it is to get going

very simple

your life will be easier

and you will sleep better at night

Thank you

We take questions

at the end plz

kwy@redpill-linpro.com