Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

14

description

 

Transcript of Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Page 1: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Page 2: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

15.6.11

Gold Sponsor ofDrupalCamp Kyiv 2011

Page 3: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

15.6.11

Silver Sponsors ofDrupalCamp Kyiv 2011

Page 4: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

What is Varnish and how it Works

Page 5: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Varnish caches backend responsesand delivers from the cache

Page 6: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Varnish stores cache entryfor each Host + URL

Page 7: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Pressflow

Pressflow = Drupal 6 with many performance tweaks

Pressflow allows:- Lazy sessions creation- No cookies for anonynous users

- Lots of Drupal 7 performance tweaks implemented

Page 8: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Pressflow Pros and Cons

Page 9: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Server Config

Page 10: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Tuning and administering Varnish

VCL - Varnish configuration language – allows to hook most of the events during handling requestsCommand line optionsVarnish Tools – cache viewer, stats viewer,

Page 11: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Varnish Configuration Language

C-like syntaxSupports regular expressionsGets translated to C code then compiled and executedHooks: vcl_recv, vcl_pipe, vcl_pass, vcl_hash, vcl_hit, vcl_miss, vcl_fetch, vcl_deliver, vcl_discard, vcl_errors

Page 12: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Code Example

backend image_server { .host = 127.0.0.1 .port = 1080}sub vcl_recv { #direct image requests to image server if(req.url ~ “(jpg|gif|png)”){ set req.backend = image_server; }}

Page 13: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Case StudiesNon-Drupal Websites

livejournal.com weather.com slideshare.netDrupal Websites drupal.org fusemusic.com

Page 14: Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011

Read more

http://www.varnish-cache.orghttp://www.pressflow.orghttp://www.google.com