Creating a Varnish Load Balancer for Opsworks
Posted on Fri 15 January 2016 in aws • Tagged with scaling, infrastructure, opsworks, varnish, chef
Varnish is an amazing platform -- it can easily help you handle 100x traffic and is easy to add to your existing frontend or API layer with little to no change to your app.
Here we'll go over some neat tricks leveraging chef, the AWS Opsworks API and the opsworks configure
lifecycle event to create a lighting fast load balancer & reverse proxy that automatically updates itself.
Setup
-
Create a new
varnish
layer that installs thevarnish
andjq
packages -
Activate custom cookbooks. It's easiest to just use s3 deployments so you don't need a separate git repo.