Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Effective, Stress-free Varnish Development (at ...

Effective, Stress-free Varnish Development (at Scale)

Here's some tips about how to leverage infrastructure-as-code to safely and effectively manage changes to a large-scale Varnish caching infrastructure.

Avatar for nstielau

nstielau

May 05, 2016
Tweet

More Decks by nstielau

Other Decks in Technology

Transcript

  1. Pantheon.io Varnish is great, serving 360k Websites Breezing through: •

    Exclusive interviews with President Obama • Drudge Report’d spikes • Various DDoS • Duck Commandering, • Year-end non-profit fundraising • $348 Million Dollar Jackpots • And many more real-world successes!
  2. Pantheon.io • Version Controlled • Peer Reviewed • Syntax checked

    • Functionally Tested • Automated Deployment Infra as code .___ _____ | | _____/ ____\___________ | |/ \ __\\_ __ \__ \ | | | \ | | | \// __ \_ |___|___| /__| |__| (____ / \/ \/ \__ \ / ___/ / __ \_\___ \ (____ /____ > \/ \/ .___ ____ ____ __ | _/____ _/ ___\/ _ \ / __ |/ __ \ \ \__( <_> ) /_/ \ ___/ \___ >____/\____ |\___ > \/ \/ \/
  3. Pantheon.io THIS IS WHAT PASSES FOR PROFESSIONAL-GRADE VARNISH ADMINISTRATION*: Current

    State of the Art ;) *Agoddard is awesome and definitely knows what the plots mean.
  4. Pantheon.io Translating to user req’s to VCL hard • Translating

    User behavior to technical functionality is hard • “Transliterating” technical functionality from code/conf to tests can yield tautologically validating tests 16
  5. Pantheon.io (User) Context Matters • Context from years of Drupal,

    WordPress, 4Kitchens, GoDaddy, Economist.com, Chapter 3, etc • We all rely on context, but how can we nuture it? 17
  6. Pantheon.io Develop and nuture user-based context by talking about the

    users. A lot. Having the (User Behavior) Conversation 18 We talk about user behaviors a lot. Too much?
  7. How we test Varnish 21 (Writing this down, I realized

    there is a lot that helps make this happen)
  8. Pantheon.io Test multiple versions of Fedora, or Varnish Varnish Port

    80 Mock Server Port 80 Varnish Port 80 Mock Server Port 80 22 20
  9. Pantheon.io Testing Architecture Mock Server Port 80 1. Test process

    spawns mock server 2. Varnish configured using Chef, pointed at mock server 3. Test process issues use-case specific HTTP requests to Varnish 4. Test process verifies correct response headers, correct backend-server accesses
  10. Pantheon.io #4: Assert response. http-Age != 0 Example: Assert images

    are cached Mock Server Port 80 #1: GET /image.jpg #2: Backend GET /image.jpg #3: Second GET /image.jpg
  11. Pantheon.io Snippit: Don’t cache big files For each extension For

    directory location For each varying cookie Assert 2nd request is miss
  12. Pantheon.io Why not varnishtest? 28 ✓ Better looping ✓ Easier

    to write ✓ Varnish agnostic ✓ Includes Chef templating, spawning ✓ Control request, response, backend request, backend response ✓ (I just found out about it)