Lessons learned at Monkigras2017

I’m currently sitting in a bar at Heathrow Airport(London), drinking mint tea, pondering on life and listening to some music while typing random thoughts on my Nordic keyboard.

Every time a (brilliant) conference gets to the end I always think how lucky I am to have the chance to travel, meet and talk to and with people. It’s great. I always feel a better and wiser person after a conference.
Monkigras 2017 in London has been absolutely brilliant, not sure if I had more fun presenting or listening to everyone else sharing their thoughts on packaging.
Here’s a list of lessons learned during those 3 days in London:

  1. When crossing a road you should first look right and then left(this is number 1 because it’s a survival tip)
  2. Tin cans have been invented in 1811 and can opener has been invented 1855: weird
  3. Open source software is free like getting a free puppy: you still have to take care of it and feed it and clean up after it!
  4. Bubble wrap was originally intended to be used as wallpaper
  5. In software there are no recalls, just updates(naming is essential here)
  6. Don’t take your metaphors literally. Juliet is my sun does not mean she will also give you skin cancer
  7. In Italy we don’t put pasta into packaging, we put it in dishes: Dish As A Service

I’m also very impressed by the number of ladies present at the conference, for the first time in years I’ve seen a line for the ladies restroom!! Well done on diversity!
Can’t wait for the next Monkigras!

VCL per saintmode e grace-Varnish Cache 4.1

Allora, senza troppi fronzoli perche’ immagino che chi sia arrivato qui abbia bisogno di un pezzo di VCL da copiare ed incollare nel proprio VCL file…ecco qui:

import directors;
sub vcl_init {

 # we create two saint-mode backends
new sm1 = saintmode.saintmode(server1, 5);
new sm2 = saintmode.saintmode(server2, 5);
#we group the backends in the same cluster
new fb = directors.fallback();

sub vcl_backend_fetch {
set bereq.backend = fb.backend();

sub vcl_backend_response {
#we set both TTL and grace values which will be used by the default vcl_hit subroutine
set beresp.ttl = 1s;
set beresp.grace = 10s;
if (beresp.status > 500) {
#the failing backend is blacklisted and we try to fetch content from another server
return (retry);

Per chi fosse interessato ad approfondire un po’ l’argomento, ecco qui un riassunto veloce:
Una delle capacita’ di Varnish Cache e’ sempre stata quella di gestire al meglio dei backend servers che si comportano maluccio e che non sono completamente affidabili.
La soluzione usata da sempre e’ combianare Saint Mode e Grace mode.

Saint mode:

Saint mode permette di gestire al meglio backend servers che “falliscono” per specifiche richieste. Il concetto e’ facile: esiste una blacklist per ogni backend, il backend viene segnato come “sick” per le richieste che non riesce a gestire per un determinato periodo di tempo. Varnish, di tutta risposta, cerca di servire contenuto un prendendolo da un altro web server oppure po’ piu’ vecchio(stale content).

Grace mode:

Grace mode ordina a Varnish di servire del contenuto anche se il suo TTL e’ espirato, questa modalita’ e’ indispensabile quando i backends non sono considerati “healthy” e non sono in grado di servire contenuto nuovo e fresco.

In Varnish 3.0 saint mode era una core feature, la stessa non e’ stata presente in Varnish 4.0, ma ha fatto il suo ritorno(a grande richiesta) in Varnish 4.1.

Come sempre, scusate per lo scarso italiano e se avete domande scrivete pure :))