SlideShare a Scribd company logo
MinneBar April 7, 2012

Varnish, The Good, The
  Awesome, and the
   Downright Crazy
         By Mike Willbanks
    Software Engineering Manager
            CaringBridge
Housekeeping…


    • Talk
      Slides will be online later!

    • Me
      Software Engineering Manager at CaringBridge

      MNPHP Organizer

      Open Source Contributor (Zend Framework and various others)

      Where you can find me:
        • Twitter: mwillbanks          G+: Mike Willbanks
        • IRC (freenode): mwillbanks   Blog: http://blog.digitalstruct.com
        • GitHub: https://github.com/mwillbanks


2
Agenda


    • What the … is Varnish?
    • The Good
      “I don’t want to listen to you but only want to play on my laptop.”

      The quick, easy and uninformed way... You listening over there?

    • The Awesome
      VCL’s, Directors and more… now we’re going places.

    • The Crazy
      ESI, Purging, VCL C, and VMOD… my head hurts, stop!

    • Varnish Command Line Apps
      varnishtop, varnishstat, etc.

    • Questions
      Although you can bring them up at anytime!
3
What the… is Varnish?
Official Statement
What the hell it means
Graphs, oh my!
Official Statement




     “Varnish is a web application accelerator. You install it in
        front of your web application and it will speed it up
                           significantly.”




5
What The Hell? Tell me!


    • Varnish allow you to accelerate your website
      By using memory and keeping in mind cookies, request headers
       and more…
    • It caches pages so that your web server can RELAX!
      What about my apache, tomcat, uhhh… (mongrel|thin|goliath….)

      Generally caching by TTL + HTTP Headers (cookies too!)

    • A load banancer, proxy and more…
      What? …. Yes, it can do that! #winning




6
A General Use Case


    • CaringBridge Status Server
      We need to get a message to our mobile users!

      The system is down, or we want to be able to communicate a
       message to them about some subject… maybe a campaign.
      The apps and mobile site rely on an API
        • Trouble in paradise? Few and far in between.
        • We want to talk to our users? Of course!
      Let an API talk to a server…

      A story on crashing and burning

      A story on a bad thing making a huge success!



7
The Graph - AWS

                 Req/s                                               Peak Load
700                                                14
600                                                12
500                                                10
400                                                 8
300                                       Req/s                                                  Peak Load
                                                    6
200                                                 4
100
                                                    2
 0
                                                    0
        Small   X-Large   Small Varnish
                                                            Small    X-Large    Small Varnish


                  Time                                               Requests
500                                               80000
450                                               70000
400
                                                  60000
350
300                                               50000
250                                               40000
                                          Time                                                    Requests
200                                               30000
150
                                                  20000
100
50                                                10000
 0                                                      0
 8      Small   X-Large   Small Varnish                      Small    X-Large    Small Varnish
The Raw Data


                Small   X-Large       Small Varnish
    Concurrency 10      150           150
    Requests    5000    55558         75000
    Time        438     347           36
    Req/s       11.42   58            585
    Peak Load 11.91     8.44          0.35
                        19,442
    Comments            failed reqs




9
The Good – Listen Up!
Installment
Documentation
Finding Existing VCL’s
Installment


     • RTM : http://goo.gl/hl4Tt
       Debian: sudo apt-get install varnish

       EPEL: yum install varnish
         • only 6.x otherwise you’ll be out of date!
       WOOT Compiling #winning #git
         • git clone git://git.varnish-cache.org/varnish-cache
         • cd varnish-cache
         • sh autogen.sh
         • ./configure
         • Make && make install



11
Documentation


     • Reference Manual
       https://www.varnish-cache.org/docs/3.0/reference/index.html

     • Tutorial – more like a book version of the reference manual
       https://www.varnish-cache.org/docs/3.0/tutorial/index.html

     • Knock yourselves out! There is a ton of documentation
         • Yes, this makes happy developers.
       Documentation is very accurate, read carefully.

       Focus heavily on VCL’s, that is generally what you need.

       I’m attempting to show you some of how this works but you will
        require the documentation to assist you.


12
Existing VCL’s – The truly lazy…


     • VCL’s are available for common open source projects
       Hi wordpress and drupal!
         • https://www.varnish-cache.org/trac/wiki/VarnishAndWordpress
         • https://www.varnish-cache.org/trac/wiki/VarnishAndDrupal
       Examples of all sorts of crazy
         • https://www.varnish-cache.org/trac/wiki/VCLExamples




13
Wordpress = Bad Slashdot Bad!!!

      backend default {
        .host = "127.0.0.1“;
        .port = "8080";
      }
      sub vcl_recv {
          if (!(req.url ~ "wp-(login|admin)")) {
              unset req.http.cookie;
          }
      }
      sub vcl_fetch {
          if (!(req.url ~ "wp-(login|admin)")) {
              unset beresp.http.set-cookie;
          }
      }




14
The Awesome – Going Places
VCL
Directors
A Few Examples
Mind ****




16
VCL – Varnish Configuration Language


     • VCL State Engine
       Each Request is Processed Separately & Independently

       States are Isolated but are Related

       Return statements exit one state and start another

       VCL defaults are ALWAYS appended below your own VCL

     • VCL can be complex, but…
       Two main subroutines; vcl_recv and vcl_fetch

       Common actions: pass, hit_for_pass, lookup, pipe, deliver

       Common variables: req, beresp and obj

       More subroutines, functions and complexity can arise dependent
        on condition.
17
VCL - Subroutines


     • vcl_init – VCL is loaded, no request yet; VMOD initialization
     • vcl_recv – Beginning of request, req is in scope
     • vcl_pipe – Client & backend data passed unaltered
     • vcl_pass – Request goes to backend and not cached
     • vcl_hash – call hash_data to add to the hash
     • vcl_hit – called on request found in the cache
     • vcl_miss – called on request not found in the cache
     • vcl_fetch – called on document retrieved from backend
     • vcl_deliver – called prior to delivery of cached object
     • vcl_error – called on errors

18
     • vcl_fini – all requests have exited VCL, cleanup of VMOD’s
VCL - Variables


     • Always Available             • Backend Req Prepartion
       now – epoch time              bereq – backend request

     • Backend Declarations         • Retrieved Backend Request
       .host – hostname / IP         beresp – backend response
       .port – port number         • Cached Object
     • Request Processing             obj – Cached object, can only
       client – ip & identity         change .ttl

       server – ip & port          • Response Preparation
       req – request information     resp – http stuff




19
VCL - Functions


     • hash_data(string) – adds a string to the hash input.
       Request host and URL is default from the default vcl.

     • regsub(string, regex, sub) – substitution on first occurance
       sub can contain numbers 0-n to inject matches from the regex.

     • regsuball(string, regex, sub) – substitution on all occurances
     • ban(expression) – Ban all objects in cache that match
     • ban(regex) – Ban all objects in cache that have a URL match




20
Directors


     • Directors allow you to talk to the backend servers
     • Directors are a glorified reverse proxy
       Allows for certain types of load balancing

       Allows for talking to a cluster



           “A director is a logical group of backend servers
         clustered together for redundancy. The basic role of
         the director is to let Varnish choose a backend server
           amongst several so if one is down another can be
                                  used.”


21
Directors – The Types


     • Random Director – picks a backend by random number
     • Client Director – picks a backend by client identity
     • Hash Director – picks a backend by URL hash value
     • Round-Robin Director – picks a backend in order
     • DNS Director – picks a backend by means of DNS
       Random OR Round-Robin

     • Fallback – picks the first “healthy” backend




22
Director - Probing


     • To ensure healthy backends, you need to use probing.
       It really sounds like a colonoscopy for servers.

     • Variables
       .url

       .request

       .window

       .threshold

       .intial

       .expected_response

       .interval

       .timeout
23
Example VCL Configuration




24
The Crazy
ESI – Edge-Side Includes
Purging
VMOD
ESI – Edge Side Includes


     • ESI is a small markup language much like SSI (server side
       includes) to include fragments (or dynamic content for that
       matter).
     • If don’t think you can use varnish because you have say,
       user information displayed on every page; think again!
     • Think of it as replacing regions inside of a page as if you
       were using XHR (AJAX).
     • Three Statements are Implemented
       esi:include – Include a page

       esi:remove – Remove content

       <!-- esi --> - ESI disabled, execute normally

26
ESI – By Diagram




27
Using ESI


     • In vcl_fetch, you must set ESI to be on
       set beresp.do_esi = true;

       By default, ESI will still cache, so add an exclusion if you need it
         • if (req.url == “/show_username.php”) {
               return (pass);
           }
       Varnish refuses to parse content for ESI if it does not look like XML
         • This is by default; so check varnishstat and varnishlog




28
ESI – By Example

     <html>
        <head><title>Rock it with ESI</title></head>
        <body>
               <header>
                  <esi:include src="/user_header.php" />
                  <!-- Don't do this as you'd lose the advantage of varnish -->
                  <!--esi
                  <?php include 'user_header.php'; ?>
                  -->
               </header>
               <section id="main"></section
               <footer></footer>
        </body>
     </html>



29
Purging – Beer anyone?


     • Sometimes, you just need to purge.
       Don’t drink too much tonight, ok?
         • If you do… find a DD or a cab.

     • The various ways of purging
       varnishadm – command line utility
         • It’s the ole finger in the back of the throat
       Sockets (port 6082) – everyone likes a good socket wrench
         • Sure, Ipecac is likely overkill.
       HTTP – now that is the sexiness
         • See, now we’re not forcing the point!


30
Purging Examples

     varnishadm -T 127.0.0.1:6082 purge req.url == "/foo/bar“


     telnet localhost 6082
     purge req.url == "/foo/bar


     telnet localhost 80
     Response:
     Trying 127.0.0.1...
     Connected to localhost.
     Escape character is '^]'.


     PURGE /foo/bar HTTP/1.0
     Host: bacon.org

31
Sexy Purging


     • Distributed Purging… now that’s a punch line!
       Use a message queue (or gearman job server)

       Have a worker that knows about the varnish servers

       Submit the request to clear the cache in the asynchronously or
        synchronously depending on your use case.
         • Have enough workers to make this effective at purging the cache
           quickly.




32
Embedding C in VCL – you must be crazy


     • Before getting into VMOD; did you know you can embed C
       into the VCL for varnish?
     • Want to do something crazy fast or leverage a C library for
       pre or post processing?
     • I know… you’re thinking that’s useless..
       On to the example; and a good one from the Varnish WIKI!




33
VCL - Embedded C for syslog – uber sexy

     C{
           #include <syslog.h>
     }C


     sub vcl_something {
           C{
                syslog(LOG_INFO, "Something happened at VCL line XX.");
           }C
     }
     # Example with using varnish variables
     C{
           syslog(LOG_ERR, "Spurious response from backend: xid %s request %s %s
         "%s" %d "%s" "%s"", VRT_r_req_xid(sp), VRT_r_req_request(sp),
         VRT_GetHdr(sp, HDR_REQ, "005host:"), VRT_r_req_url(sp),
         VRT_r_obj_status(sp), VRT_r_obj_response(sp), VRT_GetHdr(sp, HDR_OBJ,
         "011Location:"));
     }C
34
VMOD – Varnish Modules / Extensions


     • Taking VCL embedded C to the next level
     • Allows you to extend varnish and create new functions
     • Now, if you are writing modules for varnish you have a
       specialty use case!
       Go read up on it!

       https://www.varnish-cache.org/docs/trunk/reference/vmod.html




35
VMOD - std


     • The VMOD std is shipped with varnish; it provides some
       useful commands
       toupper           syslog

       tolower           fileread

       set_up_tos        duration

       Random            integer

       Log               collect




36
Varnish Command Line Apps
varnish        varnishadm    varnishhist
varnishlog     varnishncsa   varnishreplay
varnishsizes   varnishstat   varnishtest
               varnishtop
What is Varnish doing…


     • What is varnish doing right now?
     • How do I debug what is happening?
       varnishtop




38
Logging


     • Many times people want to log the requests to a file
       By default Varnish only stores these in shared memory.

       Apache Style Logs
         • varnishncsa –D –a –w log.txt




39
Cache Warmup


     • Need to warm up your cache before putting a sever in the
       queue or load test an environment?
       varnishreplay –r log.txt

     • Replaying logs can allow you to do this. This is great for
       when you are going to be deploying code to check for
       performance issues.




40
Cache Hit Ratios? No Problem


     • How to see your cache hit ratios…
       varnishstat

     • Want to parse them from XML?
       varnishstat –x




41
Questions?
These slides will be posted to SlideShare & SpeakerDeck.
 Slideshare: http://www.slideshare.net/mwillbanks

 SpeakerDeck: http://speakerdeck.com/u/mwillbanks

 Twitter: mwillbanks

 G+: Mike Willbanks

 IRC (freenode): mwillbanks

 Blog: http://blog.digitalstruct.com

 GitHub: https://github.com/mwillbanks

More Related Content

What's hot

Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
Rich Bowen
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBox
bobmcwhirter
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
bobmcwhirter
 
Cloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinCloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and Vaadin
Joshua Long
 
Chef - Evolving with Infrastructure Automation
Chef - Evolving with Infrastructure AutomationChef - Evolving with Infrastructure Automation
Chef - Evolving with Infrastructure Automation
Nathaniel Brown
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprisebenbrowning
 
Apache Camel: The Swiss Army Knife of Open Source Integration
Apache Camel: The Swiss Army Knife of Open Source IntegrationApache Camel: The Swiss Army Knife of Open Source Integration
Apache Camel: The Swiss Army Knife of Open Source Integration
prajods
 
AP4R on Developers Summit 2008
AP4R on Developers Summit 2008AP4R on Developers Summit 2008
AP4R on Developers Summit 2008Kato Kiwamu
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
Matt Ray
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
Fabio Akita
 
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014David Delabassee
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesEric Bottard
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
Shaer Hassan
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on Netscaler
Mark Hillick
 
Novalug 07142012
Novalug 07142012Novalug 07142012
Novalug 07142012
Mandi Walls
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011Marcelo Jabali
 
What I did in My Internship @ WSO2
What I did in My Internship @ WSO2What I did in My Internship @ WSO2
What I did in My Internship @ WSO2
Andun Sameera
 

What's hot (19)

Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBox
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Cloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinCloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and Vaadin
 
Chef - Evolving with Infrastructure Automation
Chef - Evolving with Infrastructure AutomationChef - Evolving with Infrastructure Automation
Chef - Evolving with Infrastructure Automation
 
First Day With J Ruby
First Day With J RubyFirst Day With J Ruby
First Day With J Ruby
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprise
 
Apache Camel: The Swiss Army Knife of Open Source Integration
Apache Camel: The Swiss Army Knife of Open Source IntegrationApache Camel: The Swiss Army Knife of Open Source Integration
Apache Camel: The Swiss Army Knife of Open Source Integration
 
AP4R on Developers Summit 2008
AP4R on Developers Summit 2008AP4R on Developers Summit 2008
AP4R on Developers Summit 2008
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
 
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on Netscaler
 
Novalug 07142012
Novalug 07142012Novalug 07142012
Novalug 07142012
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
 
What I did in My Internship @ WSO2
What I did in My Internship @ WSO2What I did in My Internship @ WSO2
What I did in My Internship @ WSO2
 

Viewers also liked

Room Service Furniture Rentals
Room Service Furniture RentalsRoom Service Furniture Rentals
Room Service Furniture RentalsRoomServiceRentals
 
Trackless Speed Gate
Trackless  Speed GateTrackless  Speed Gate
Trackless Speed Gate
cholder
 
Comparatives1
Comparatives1Comparatives1
Comparatives1
lola guillen
 
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body LanguageIRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
sarahnovotny
 
Future Success Web 2 Overview
Future Success Web 2 OverviewFuture Success Web 2 Overview
Future Success Web 2 Overview
papin0
 
Dec 06, Sermon Am
Dec 06, Sermon AmDec 06, Sermon Am
Dec 06, Sermon AmGeo Acts
 
Soc. Unit I, Packet 2
Soc. Unit I, Packet 2Soc. Unit I, Packet 2
Soc. Unit I, Packet 2NHSDAnderson
 
Social Game的技术挑战
Social Game的技术挑战Social Game的技术挑战
Social Game的技术挑战
Robbin Fan
 
第10-11週
第10-11週第10-11週
第10-11週
fudy9015
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfalls
Robbin Fan
 
Disability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDisability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDougIngram
 
Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012
Mike Willbanks
 
Practical Econ, U1, Packet 1
Practical Econ, U1, Packet 1Practical Econ, U1, Packet 1
Practical Econ, U1, Packet 1NHSDAnderson
 
Resume
ResumeResume
liceo paola cs
liceo paola csliceo paola cs
liceo paola cs
gueroz4
 
Cap 4 gases-3662
Cap 4 gases-3662Cap 4 gases-3662
Cap 4 gases-3662
opulento22
 

Viewers also liked (20)

Europe
EuropeEurope
Europe
 
Room Service Furniture Rentals
Room Service Furniture RentalsRoom Service Furniture Rentals
Room Service Furniture Rentals
 
Trackless Speed Gate
Trackless  Speed GateTrackless  Speed Gate
Trackless Speed Gate
 
Comparatives1
Comparatives1Comparatives1
Comparatives1
 
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body LanguageIRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
 
Future Success Web 2 Overview
Future Success Web 2 OverviewFuture Success Web 2 Overview
Future Success Web 2 Overview
 
Dec 06, Sermon Am
Dec 06, Sermon AmDec 06, Sermon Am
Dec 06, Sermon Am
 
Soc. Unit I, Packet 2
Soc. Unit I, Packet 2Soc. Unit I, Packet 2
Soc. Unit I, Packet 2
 
Social Game的技术挑战
Social Game的技术挑战Social Game的技术挑战
Social Game的技术挑战
 
第10-11週
第10-11週第10-11週
第10-11週
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfalls
 
Disability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDisability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step Guide
 
Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012
 
Presentation1
Presentation1Presentation1
Presentation1
 
Practical Econ, U1, Packet 1
Practical Econ, U1, Packet 1Practical Econ, U1, Packet 1
Practical Econ, U1, Packet 1
 
Debt Taxes
Debt TaxesDebt Taxes
Debt Taxes
 
Inbooki
Inbooki Inbooki
Inbooki
 
Resume
ResumeResume
Resume
 
liceo paola cs
liceo paola csliceo paola cs
liceo paola cs
 
Cap 4 gases-3662
Cap 4 gases-3662Cap 4 gases-3662
Cap 4 gases-3662
 

Similar to Varnish, The Good, The Awesome, and the Downright Crazy.

Usenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a ProxyUsenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a Proxy
Leif Hedstrom
 
Usenix lisa 2011
Usenix lisa 2011Usenix lisa 2011
Usenix lisa 2011
Leif Hedstrom
 
Apache con 2011 gd
Apache con 2011 gdApache con 2011 gd
Apache con 2011 gd
Leif Hedstrom
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Resin Outperforms NginX
Resin Outperforms NginXResin Outperforms NginX
Resin Outperforms NginX
billdigman
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
Fabio Akita
 
Node.js Performance Case Study
Node.js Performance Case StudyNode.js Performance Case Study
Node.js Performance Case Study
Fabian Frank
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
q3boy
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
Jean-Francois James
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
David Newman
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Michele Orru
 
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
rhatr
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
Kris Mok
 
Lattice yapc-slideshare
Lattice yapc-slideshareLattice yapc-slideshare
Lattice yapc-slideshare
Gwenn Etourneau
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
Paolo Negri
 
Meetup open stack_grizzly
Meetup open stack_grizzlyMeetup open stack_grizzly
Meetup open stack_grizzly
eNovance
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
tianyi5212222
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
http403
 

Similar to Varnish, The Good, The Awesome, and the Downright Crazy. (20)

Varnish Cache
Varnish CacheVarnish Cache
Varnish Cache
 
Usenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a ProxyUsenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a Proxy
 
Usenix lisa 2011
Usenix lisa 2011Usenix lisa 2011
Usenix lisa 2011
 
Apache con 2011 gd
Apache con 2011 gdApache con 2011 gd
Apache con 2011 gd
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Resin Outperforms NginX
Resin Outperforms NginXResin Outperforms NginX
Resin Outperforms NginX
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Node.js Performance Case Study
Node.js Performance Case StudyNode.js Performance Case Study
Node.js Performance Case Study
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
 
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
Lattice yapc-slideshare
Lattice yapc-slideshareLattice yapc-slideshare
Lattice yapc-slideshare
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
Meetup open stack_grizzly
Meetup open stack_grizzlyMeetup open stack_grizzly
Meetup open stack_grizzly
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 

More from Mike Willbanks

2015 ZendCon - Do you queue
2015 ZendCon - Do you queue2015 ZendCon - Do you queue
2015 ZendCon - Do you queue
Mike Willbanks
 
ZF2: Writing Service Components
ZF2: Writing Service ComponentsZF2: Writing Service Components
ZF2: Writing Service Components
Mike Willbanks
 
Writing Services with ZF2
Writing Services with ZF2Writing Services with ZF2
Writing Services with ZF2
Mike Willbanks
 
Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)
Mike Willbanks
 
Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012Mike Willbanks
 
Leveraging Zend Framework for Sending Push Notifications
Leveraging Zend Framework for Sending Push NotificationsLeveraging Zend Framework for Sending Push Notifications
Leveraging Zend Framework for Sending Push NotificationsMike Willbanks
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleMike Willbanks
 
Varnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright CrazyVarnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright CrazyMike Willbanks
 
Zend Framework Push Notifications
Zend Framework Push NotificationsZend Framework Push Notifications
Zend Framework Push Notifications
Mike Willbanks
 
Mobile Push Notifications
Mobile Push NotificationsMobile Push Notifications
Mobile Push Notifications
Mike Willbanks
 
SOA with Zend Framework
SOA with Zend FrameworkSOA with Zend Framework
SOA with Zend Framework
Mike Willbanks
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
Mike Willbanks
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKXMike Willbanks
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101Mike Willbanks
 
The Art of Message Queues
The Art of Message QueuesThe Art of Message Queues
The Art of Message Queues
Mike Willbanks
 
Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
Mike Willbanks
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
Mike Willbanks
 

More from Mike Willbanks (18)

2015 ZendCon - Do you queue
2015 ZendCon - Do you queue2015 ZendCon - Do you queue
2015 ZendCon - Do you queue
 
ZF2: Writing Service Components
ZF2: Writing Service ComponentsZF2: Writing Service Components
ZF2: Writing Service Components
 
Writing Services with ZF2
Writing Services with ZF2Writing Services with ZF2
Writing Services with ZF2
 
Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)
 
Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012
 
Leveraging Zend Framework for Sending Push Notifications
Leveraging Zend Framework for Sending Push NotificationsLeveraging Zend Framework for Sending Push Notifications
Leveraging Zend Framework for Sending Push Notifications
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for Scale
 
Varnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright CrazyVarnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright Crazy
 
Zend Framework Push Notifications
Zend Framework Push NotificationsZend Framework Push Notifications
Zend Framework Push Notifications
 
Mobile Push Notifications
Mobile Push NotificationsMobile Push Notifications
Mobile Push Notifications
 
SOA with Zend Framework
SOA with Zend FrameworkSOA with Zend Framework
SOA with Zend Framework
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
Art Of Message Queues
Art Of Message QueuesArt Of Message Queues
Art Of Message Queues
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101
 
The Art of Message Queues
The Art of Message QueuesThe Art of Message Queues
The Art of Message Queues
 
Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Varnish, The Good, The Awesome, and the Downright Crazy.

  • 1. MinneBar April 7, 2012 Varnish, The Good, The Awesome, and the Downright Crazy By Mike Willbanks Software Engineering Manager CaringBridge
  • 2. Housekeeping… • Talk  Slides will be online later! • Me  Software Engineering Manager at CaringBridge  MNPHP Organizer  Open Source Contributor (Zend Framework and various others)  Where you can find me: • Twitter: mwillbanks G+: Mike Willbanks • IRC (freenode): mwillbanks Blog: http://blog.digitalstruct.com • GitHub: https://github.com/mwillbanks 2
  • 3. Agenda • What the … is Varnish? • The Good  “I don’t want to listen to you but only want to play on my laptop.”  The quick, easy and uninformed way... You listening over there? • The Awesome  VCL’s, Directors and more… now we’re going places. • The Crazy  ESI, Purging, VCL C, and VMOD… my head hurts, stop! • Varnish Command Line Apps  varnishtop, varnishstat, etc. • Questions  Although you can bring them up at anytime! 3
  • 4. What the… is Varnish? Official Statement What the hell it means Graphs, oh my!
  • 5. Official Statement “Varnish is a web application accelerator. You install it in front of your web application and it will speed it up significantly.” 5
  • 6. What The Hell? Tell me! • Varnish allow you to accelerate your website  By using memory and keeping in mind cookies, request headers and more… • It caches pages so that your web server can RELAX!  What about my apache, tomcat, uhhh… (mongrel|thin|goliath….)  Generally caching by TTL + HTTP Headers (cookies too!) • A load banancer, proxy and more…  What? …. Yes, it can do that! #winning 6
  • 7. A General Use Case • CaringBridge Status Server  We need to get a message to our mobile users!  The system is down, or we want to be able to communicate a message to them about some subject… maybe a campaign.  The apps and mobile site rely on an API • Trouble in paradise? Few and far in between. • We want to talk to our users? Of course!  Let an API talk to a server…  A story on crashing and burning  A story on a bad thing making a huge success! 7
  • 8. The Graph - AWS Req/s Peak Load 700 14 600 12 500 10 400 8 300 Req/s Peak Load 6 200 4 100 2 0 0 Small X-Large Small Varnish Small X-Large Small Varnish Time Requests 500 80000 450 70000 400 60000 350 300 50000 250 40000 Time Requests 200 30000 150 20000 100 50 10000 0 0 8 Small X-Large Small Varnish Small X-Large Small Varnish
  • 9. The Raw Data Small X-Large Small Varnish Concurrency 10 150 150 Requests 5000 55558 75000 Time 438 347 36 Req/s 11.42 58 585 Peak Load 11.91 8.44 0.35 19,442 Comments failed reqs 9
  • 10. The Good – Listen Up! Installment Documentation Finding Existing VCL’s
  • 11. Installment • RTM : http://goo.gl/hl4Tt  Debian: sudo apt-get install varnish  EPEL: yum install varnish • only 6.x otherwise you’ll be out of date!  WOOT Compiling #winning #git • git clone git://git.varnish-cache.org/varnish-cache • cd varnish-cache • sh autogen.sh • ./configure • Make && make install 11
  • 12. Documentation • Reference Manual  https://www.varnish-cache.org/docs/3.0/reference/index.html • Tutorial – more like a book version of the reference manual  https://www.varnish-cache.org/docs/3.0/tutorial/index.html • Knock yourselves out! There is a ton of documentation • Yes, this makes happy developers.  Documentation is very accurate, read carefully.  Focus heavily on VCL’s, that is generally what you need.  I’m attempting to show you some of how this works but you will require the documentation to assist you. 12
  • 13. Existing VCL’s – The truly lazy… • VCL’s are available for common open source projects  Hi wordpress and drupal! • https://www.varnish-cache.org/trac/wiki/VarnishAndWordpress • https://www.varnish-cache.org/trac/wiki/VarnishAndDrupal  Examples of all sorts of crazy • https://www.varnish-cache.org/trac/wiki/VCLExamples 13
  • 14. Wordpress = Bad Slashdot Bad!!! backend default { .host = "127.0.0.1“; .port = "8080"; } sub vcl_recv { if (!(req.url ~ "wp-(login|admin)")) { unset req.http.cookie; } } sub vcl_fetch { if (!(req.url ~ "wp-(login|admin)")) { unset beresp.http.set-cookie; } } 14
  • 15. The Awesome – Going Places VCL Directors A Few Examples
  • 17. VCL – Varnish Configuration Language • VCL State Engine  Each Request is Processed Separately & Independently  States are Isolated but are Related  Return statements exit one state and start another  VCL defaults are ALWAYS appended below your own VCL • VCL can be complex, but…  Two main subroutines; vcl_recv and vcl_fetch  Common actions: pass, hit_for_pass, lookup, pipe, deliver  Common variables: req, beresp and obj  More subroutines, functions and complexity can arise dependent on condition. 17
  • 18. VCL - Subroutines • vcl_init – VCL is loaded, no request yet; VMOD initialization • vcl_recv – Beginning of request, req is in scope • vcl_pipe – Client & backend data passed unaltered • vcl_pass – Request goes to backend and not cached • vcl_hash – call hash_data to add to the hash • vcl_hit – called on request found in the cache • vcl_miss – called on request not found in the cache • vcl_fetch – called on document retrieved from backend • vcl_deliver – called prior to delivery of cached object • vcl_error – called on errors 18 • vcl_fini – all requests have exited VCL, cleanup of VMOD’s
  • 19. VCL - Variables • Always Available • Backend Req Prepartion  now – epoch time  bereq – backend request • Backend Declarations • Retrieved Backend Request  .host – hostname / IP  beresp – backend response  .port – port number • Cached Object • Request Processing  obj – Cached object, can only  client – ip & identity change .ttl  server – ip & port • Response Preparation  req – request information  resp – http stuff 19
  • 20. VCL - Functions • hash_data(string) – adds a string to the hash input.  Request host and URL is default from the default vcl. • regsub(string, regex, sub) – substitution on first occurance  sub can contain numbers 0-n to inject matches from the regex. • regsuball(string, regex, sub) – substitution on all occurances • ban(expression) – Ban all objects in cache that match • ban(regex) – Ban all objects in cache that have a URL match 20
  • 21. Directors • Directors allow you to talk to the backend servers • Directors are a glorified reverse proxy  Allows for certain types of load balancing  Allows for talking to a cluster “A director is a logical group of backend servers clustered together for redundancy. The basic role of the director is to let Varnish choose a backend server amongst several so if one is down another can be used.” 21
  • 22. Directors – The Types • Random Director – picks a backend by random number • Client Director – picks a backend by client identity • Hash Director – picks a backend by URL hash value • Round-Robin Director – picks a backend in order • DNS Director – picks a backend by means of DNS  Random OR Round-Robin • Fallback – picks the first “healthy” backend 22
  • 23. Director - Probing • To ensure healthy backends, you need to use probing.  It really sounds like a colonoscopy for servers. • Variables  .url  .request  .window  .threshold  .intial  .expected_response  .interval  .timeout 23
  • 25. The Crazy ESI – Edge-Side Includes Purging VMOD
  • 26. ESI – Edge Side Includes • ESI is a small markup language much like SSI (server side includes) to include fragments (or dynamic content for that matter). • If don’t think you can use varnish because you have say, user information displayed on every page; think again! • Think of it as replacing regions inside of a page as if you were using XHR (AJAX). • Three Statements are Implemented  esi:include – Include a page  esi:remove – Remove content  <!-- esi --> - ESI disabled, execute normally 26
  • 27. ESI – By Diagram 27
  • 28. Using ESI • In vcl_fetch, you must set ESI to be on  set beresp.do_esi = true;  By default, ESI will still cache, so add an exclusion if you need it • if (req.url == “/show_username.php”) { return (pass); }  Varnish refuses to parse content for ESI if it does not look like XML • This is by default; so check varnishstat and varnishlog 28
  • 29. ESI – By Example <html> <head><title>Rock it with ESI</title></head> <body> <header> <esi:include src="/user_header.php" /> <!-- Don't do this as you'd lose the advantage of varnish --> <!--esi <?php include 'user_header.php'; ?> --> </header> <section id="main"></section <footer></footer> </body> </html> 29
  • 30. Purging – Beer anyone? • Sometimes, you just need to purge.  Don’t drink too much tonight, ok? • If you do… find a DD or a cab. • The various ways of purging  varnishadm – command line utility • It’s the ole finger in the back of the throat  Sockets (port 6082) – everyone likes a good socket wrench • Sure, Ipecac is likely overkill.  HTTP – now that is the sexiness • See, now we’re not forcing the point! 30
  • 31. Purging Examples varnishadm -T 127.0.0.1:6082 purge req.url == "/foo/bar“ telnet localhost 6082 purge req.url == "/foo/bar telnet localhost 80 Response: Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. PURGE /foo/bar HTTP/1.0 Host: bacon.org 31
  • 32. Sexy Purging • Distributed Purging… now that’s a punch line!  Use a message queue (or gearman job server)  Have a worker that knows about the varnish servers  Submit the request to clear the cache in the asynchronously or synchronously depending on your use case. • Have enough workers to make this effective at purging the cache quickly. 32
  • 33. Embedding C in VCL – you must be crazy • Before getting into VMOD; did you know you can embed C into the VCL for varnish? • Want to do something crazy fast or leverage a C library for pre or post processing? • I know… you’re thinking that’s useless..  On to the example; and a good one from the Varnish WIKI! 33
  • 34. VCL - Embedded C for syslog – uber sexy C{ #include <syslog.h> }C sub vcl_something { C{ syslog(LOG_INFO, "Something happened at VCL line XX."); }C } # Example with using varnish variables C{ syslog(LOG_ERR, "Spurious response from backend: xid %s request %s %s "%s" %d "%s" "%s"", VRT_r_req_xid(sp), VRT_r_req_request(sp), VRT_GetHdr(sp, HDR_REQ, "005host:"), VRT_r_req_url(sp), VRT_r_obj_status(sp), VRT_r_obj_response(sp), VRT_GetHdr(sp, HDR_OBJ, "011Location:")); }C 34
  • 35. VMOD – Varnish Modules / Extensions • Taking VCL embedded C to the next level • Allows you to extend varnish and create new functions • Now, if you are writing modules for varnish you have a specialty use case!  Go read up on it!  https://www.varnish-cache.org/docs/trunk/reference/vmod.html 35
  • 36. VMOD - std • The VMOD std is shipped with varnish; it provides some useful commands  toupper  syslog  tolower  fileread  set_up_tos  duration  Random  integer  Log  collect 36
  • 37. Varnish Command Line Apps varnish varnishadm varnishhist varnishlog varnishncsa varnishreplay varnishsizes varnishstat varnishtest varnishtop
  • 38. What is Varnish doing… • What is varnish doing right now? • How do I debug what is happening?  varnishtop 38
  • 39. Logging • Many times people want to log the requests to a file  By default Varnish only stores these in shared memory.  Apache Style Logs • varnishncsa –D –a –w log.txt 39
  • 40. Cache Warmup • Need to warm up your cache before putting a sever in the queue or load test an environment?  varnishreplay –r log.txt • Replaying logs can allow you to do this. This is great for when you are going to be deploying code to check for performance issues. 40
  • 41. Cache Hit Ratios? No Problem • How to see your cache hit ratios…  varnishstat • Want to parse them from XML?  varnishstat –x 41
  • 42. Questions? These slides will be posted to SlideShare & SpeakerDeck. Slideshare: http://www.slideshare.net/mwillbanks SpeakerDeck: http://speakerdeck.com/u/mwillbanks Twitter: mwillbanks G+: Mike Willbanks IRC (freenode): mwillbanks Blog: http://blog.digitalstruct.com GitHub: https://github.com/mwillbanks