Giter Club home page Giter Club logo

varnish's Introduction

Juju Charm: varnish
Author: Nathan Williams

0. INTRODUCTION
########################################################################

Varnish Cache is a "web application accelerator", or an HTTP reverse 
proxy. By deploying varnish in front of an HTTP server, it can speed up 
delivery by a factor of 300-1000x, depending on configuration.

What makes Varnish Cache so powerful is the Varnish Cache Language (VCL). By 
using VCL to configure Varnish Cache for your site, you can see 
*remarkable* performance improvements.

This varnish charm has also been set up to use a self-policing, round-
robin load-balancer (director) that distributes the load between your 
HTTP backends. Any backends defined by related website relations will 
be monitored, and in the event that they repeatedly fail to respond, 
Varnish Cache will stop sending it requests until it is healthy.

1. REQUIREMENTS
########################################################################

Varnish Cache requires a backend that serves content with HTTP. 
 
2. GETTING STARTED DEPLOYING VARNISH
########################################################################

Bootstrap your juju environment:

    juju bootstrap

Deploy a varnish (reverse-proxy) instance:

    juju deploy varnish

Expose the service:

    juju expose varnish

Connect varnish and wordpress:

    juju add-relation varnish wordpress

3. CONFIGURING VARNISH
########################################################################
Configuration options:

The varnish charm allows you to configure varnish's listening port in 
your own config.yaml.

Tune your Varnish Cache deployment:

It also includes some common-sense tuning tweaks in data/extra.vcl.

If you wish to add extra (application-specific?) configuration, feel
free to add your VCL changes to data/extra.vcl. It shouldn't interfere
with the charm deployment, and will retain the round-robin director as
as long as you keep the following line in your vcl_receive:

    set req.backend = balance;


4. MORE INFORMATION
########################################################################
To verify Varnish Cache is delivering cached content, check the HTTP 
headers by running the following command twice:

    curl -I -H "Host: <backend address>" http://<varnish address>/

To verify the site content is delivered from the backend:

    curl -H "Host: 192.168.122.242" http://192.168.122.111/

For more information about Varnish Cache, check out their official docs:

    https://www.varnish-cache.org/docs/3.0/

5. IMPROVEMENTS? BUGS?
########################################################################
If you find a bug, or know any optimization tricks that are application 
agnostic, let us know!

6. THE END
########################################################################
To destroy all your services, you can run:

    juju destroy-environment

varnish's People

Contributors

okalex avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.