SlideShare une entreprise Scribd logo
1  sur  53
Marcus Deglos
@manarth
#cdl2011
> Old
           faithful, serving
           sites since 1996.
         > Quick
         > Simple
Apache
Apache's model


             Web server
Apache's model with PHP


                      Web server




               PHP engine
Do it with Drupal


                   Web server
                                  DB


                                index.php


            PHP engine
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"

"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html

                        Example HTML
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr"

xmlns:content="http://purl.org/rss/1.0/modules/content/"

xmlns:dc="http://purl.org/dc/terms/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"

xmlns:og="http://ogp.me/ns#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

xmlns:sioc="http://rdfs.org/sioc/ns#"
 xmlns:sioct="http://rdfs.org/sioc/types#"

xmlns:skos="http://www.w3.org/2004/02/skos/core#"

xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<head
profile="http://www.w3.org/1999/xhtml/vocab">
 <meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<link rel="shortcut icon"
href="http://testbed.local/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta
name="Generator" content="Drupal 7 (http://drupal.org)" />
 <title>Welcome to Site-Install |
Site-Install</title>




                HTML from homepage after
                          running drushsi
Drag race results
> Prepared in
          advance
        > Typically uses a
          build-script
        > Produces static
          pages
        > Quick
        > No complex
          behaviour
        > Boost module is an
Baked     example
> Pages created on
  the fly
> CMS or other
  complex dynamic
  system
> Allows complex
  behaviour
> Drupal does this
> Slow
                     Fried
> Software
                     package
                     (daemon) for
                     linux
                   > Reverse proxy,
                     such as Squid,
                     Nginx and Zeus
What is Varnish?   > Cache
How Varnish works
   GET /blog
   Host   deglos.com
   User-AgentMozilla/5.0 (Macintosh; Intel
   Mac OS X 10.6; rv:8.0.1) Gecko/20100101
   Firefox/8.0.1
   Accept
      text/html,application/xhtml+xml,applic
   ation/xml;q=0.9,*/*;q=0.8
   Varnish                Drupal
   Accept-Language en-us,en;q=0.5
   Accept-Encoding gzip, deflate
   Accept-Charset    ISO-8859-1,utf-
   8;q=0.7,*;q=0.7
   Connectionkeep-alive
Varnish is slower
  If Varnish passes every request to Drupal
  – and acts just as a MITM – your site will
  be slower.



  Varnish               Drupal
Varnish needs to cache



     Varnish           Drupal




               Cache
Varnish + cache is quicker
   10x faster
   (or more)



          Varnish           Drupal




                    Cache
Personalisation is a problem



        Varnish           Drupal




                  Cache
The Uncacheable



  Varnish           Drupal




            Cache
Example VCL:
#This is a basic VCL configuration file for
  varnish.
backend default {
  .host = "127.0.0.1";
  .port = "80";
}

sub vcl_fetch {
  unset obj.http.Cache-Control;
  unset obj.http.Expires;
  set obj.ttl = 86400s;
}
vcl.list
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
vcl.list
200 23
active          1 boot
help
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
help
200 376
help [command]
ping [timestamp]
status
start
stop
stats
...
url.purge
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
url.purge .*
200 0
Setting up Varnish
> Download varnish daemon
  debian: apt-get install varnish
  redhat:yum install varnish
> Re-configure Apache to listen on port 8080
  (or other non-standard port)
> Configure Varnish to listen on port 80
> Configure Varnish VCL to connect to
  Apache
> VCL tweaks (default does not cache
  Drupal)
Serving ESIs



Varnish           Drupal




          Cache
Serving ESIs



Varnish           Drupal




          Cache
Serving ESIs
<div id="nav-masthead" class="grid-12">
<ul>
<li class="homepage active first active">
<a href="/home" class="active active">Drupal Homepage</a>
</li>
<li class="dashboard last">
<a href="/user/dashboard">Your Dashboard</a>
</li>
</ul>                   Varnish                      Drupal
<div id="userinfo">
<a href="/user" title="View &amp; edit your user profile">Logged in as
manarth</a>
<a href="/logout">Log out</a>
</div>
</div><!-- /#nav-masthead -->            Cache
Serving ESIs
<div id="nav-masthead" class="grid-12">
<ul>
<li class="homepage active first active">
<a href="/home" class="active active">Drupal Homepage</a>
</li>
<li class="dashboard last">
<a href="/user/dashboard">Your Dashboard</a>
</li>
</ul>                 Varnish                 Drupal
<esisrc="http://example.com/esi/userinfo" />




</div><!-- /#nav-masthead -->     Cache
Serving ESIs

<div id="userinfo">
<a href="/user" title="View &amp; edit your user profile">Logged in
as manarth</a>
<a href="/logout">Log out</a>
</div>
                 Varnish                     Drupal




                                  Cache
What do you need in order to do
             ESIs?
> Replace personalisationwith ESI tags
  Theme-alters?
> Provide backend hook_menuhandlers for
  each ESI tag
> Ensure that Varnish is caching
> Rule 35 applies
Configuring ESI Blocks
Flickr Credits
> Babbage engine
  http://www.flickr.com/photos/melgart/4444251
  225
> Cookies
  http://www.flickr.com/photos/sabine01/24855
  02578
> Frying wok
  http://www.flickr.com/photos/18403292@N00/
  3048993
> Varnish
  http://www.flickr.com/photos/dawniecakes/46
  86467791
Drupal, varnish, esi - Toulouse November 2

Contenu connexe

Tendances

Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Serveraaroncouch
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 
HBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockHBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockMichael Stack
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)Venugopal Gummadala
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)WordCamp Cape Town
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpSander Temme
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...OVHcloud
 
Using memcache to improve php performance
Using memcache to improve php performanceUsing memcache to improve php performance
Using memcache to improve php performanceSudar Muthu
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apacheShaojie Yang
 
Develop with linux containers and docker
Develop with linux containers and dockerDevelop with linux containers and docker
Develop with linux containers and dockerFabio Fumarola
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
HBaseConEast2016: Practical Kerberos with Apache HBase
HBaseConEast2016: Practical Kerberos with Apache HBaseHBaseConEast2016: Practical Kerberos with Apache HBase
HBaseConEast2016: Practical Kerberos with Apache HBaseMichael Stack
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloudTahsin Hasan
 

Tendances (20)

Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
 
Varnish - PLNOG 4
Varnish - PLNOG 4Varnish - PLNOG 4
Varnish - PLNOG 4
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
HBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockHBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with Clusterdock
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling Up
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Apache Web Server Setup 1
Apache Web Server Setup 1Apache Web Server Setup 1
Apache Web Server Setup 1
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
 
Using memcache to improve php performance
Using memcache to improve php performanceUsing memcache to improve php performance
Using memcache to improve php performance
 
Apache Web Server Setup 4
Apache Web Server Setup 4Apache Web Server Setup 4
Apache Web Server Setup 4
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apache
 
Develop with linux containers and docker
Develop with linux containers and dockerDevelop with linux containers and docker
Develop with linux containers and docker
 
Corley scalability
Corley scalabilityCorley scalability
Corley scalability
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
HBaseConEast2016: Practical Kerberos with Apache HBase
HBaseConEast2016: Practical Kerberos with Apache HBaseHBaseConEast2016: Practical Kerberos with Apache HBase
HBaseConEast2016: Practical Kerberos with Apache HBase
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 

Similaire à Drupal, varnish, esi - Toulouse November 2

Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Rich Bowen
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by CapistranoTasawr Interactive
 
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...Codemotion
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansiblesriram_rajan
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using DockerRuss Mckendrick
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Cache all the things - A guide to caching Drupal
Cache all the things - A guide to caching DrupalCache all the things - A guide to caching Drupal
Cache all the things - A guide to caching Drupaldigital006
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Rich Bowen
 
Drupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case StudyDrupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case Studyhernanibf
 
Why Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container TechnologyWhy Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container TechnologySagi Brody
 
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 2011Mike Willbanks
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 

Similaire à Drupal, varnish, esi - Toulouse November 2 (20)

Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
 
2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Apache
ApacheApache
Apache
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
Cis 274 intro
Cis 274   introCis 274   intro
Cis 274 intro
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Cache all the things - A guide to caching Drupal
Cache all the things - A guide to caching DrupalCache all the things - A guide to caching Drupal
Cache all the things - A guide to caching Drupal
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
 
Drupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case StudyDrupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case Study
 
Why Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container TechnologyWhy Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container Technology
 
Apache - Quick reference guide
Apache - Quick reference guideApache - Quick reference guide
Apache - Quick reference guide
 
Rack
RackRack
Rack
 
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
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 

Plus de Marcus Deglos

Plus de Marcus Deglos (6)

Vagrant crash course
Vagrant crash courseVagrant crash course
Vagrant crash course
 
Drupal haters gonna hate
Drupal haters gonna hateDrupal haters gonna hate
Drupal haters gonna hate
 
With one click
With one clickWith one click
With one click
 
Panels rocks!
Panels rocks!Panels rocks!
Panels rocks!
 
SSO To go
SSO To goSSO To go
SSO To go
 
Where in the world
Where in the worldWhere in the world
Where in the world
 

Dernier

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

Drupal, varnish, esi - Toulouse November 2

  • 1.
  • 3.
  • 4. > Old faithful, serving sites since 1996. > Quick > Simple Apache
  • 5. Apache's model Web server
  • 6. Apache's model with PHP Web server PHP engine
  • 7. Do it with Drupal Web server DB index.php PHP engine
  • 8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
 "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html Example HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:dc="http://purl.org/dc/terms/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"
 xmlns:og="http://ogp.me/ns#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 xmlns:sioc="http://rdfs.org/sioc/ns#"
 xmlns:sioct="http://rdfs.org/sioc/types#"
 xmlns:skos="http://www.w3.org/2004/02/skos/core#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<head profile="http://www.w3.org/1999/xhtml/vocab">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="http://testbed.local/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
 <title>Welcome to Site-Install | Site-Install</title> HTML from homepage after running drushsi
  • 10.
  • 11.
  • 12.
  • 13. > Prepared in advance > Typically uses a build-script > Produces static pages > Quick > No complex behaviour > Boost module is an Baked example
  • 14. > Pages created on the fly > CMS or other complex dynamic system > Allows complex behaviour > Drupal does this > Slow Fried
  • 15.
  • 16. > Software package (daemon) for linux > Reverse proxy, such as Squid, Nginx and Zeus What is Varnish? > Cache
  • 17. How Varnish works GET /blog Host deglos.com User-AgentMozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1 Accept text/html,application/xhtml+xml,applic ation/xml;q=0.9,*/*;q=0.8 Varnish Drupal Accept-Language en-us,en;q=0.5 Accept-Encoding gzip, deflate Accept-Charset ISO-8859-1,utf- 8;q=0.7,*;q=0.7 Connectionkeep-alive
  • 18. Varnish is slower If Varnish passes every request to Drupal – and acts just as a MITM – your site will be slower. Varnish Drupal
  • 19. Varnish needs to cache Varnish Drupal Cache
  • 20. Varnish + cache is quicker 10x faster (or more) Varnish Drupal Cache
  • 21. Personalisation is a problem Varnish Drupal Cache
  • 22. The Uncacheable Varnish Drupal Cache
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Example VCL: #This is a basic VCL configuration file for varnish. backend default { .host = "127.0.0.1"; .port = "80"; } sub vcl_fetch { unset obj.http.Cache-Control; unset obj.http.Expires; set obj.ttl = 86400s; }
  • 28.
  • 29.
  • 30. vcl.list telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. vcl.list 200 23 active 1 boot
  • 31. help telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. help 200 376 help [command] ping [timestamp] status start stop stats ...
  • 32. url.purge telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. url.purge .* 200 0
  • 33.
  • 34. Setting up Varnish > Download varnish daemon debian: apt-get install varnish redhat:yum install varnish > Re-configure Apache to listen on port 8080 (or other non-standard port) > Configure Varnish to listen on port 80 > Configure Varnish VCL to connect to Apache > VCL tweaks (default does not cache Drupal)
  • 35.
  • 36.
  • 37. Serving ESIs Varnish Drupal Cache
  • 38. Serving ESIs Varnish Drupal Cache
  • 39. Serving ESIs <div id="nav-masthead" class="grid-12"> <ul> <li class="homepage active first active"> <a href="/home" class="active active">Drupal Homepage</a> </li> <li class="dashboard last"> <a href="/user/dashboard">Your Dashboard</a> </li> </ul> Varnish Drupal <div id="userinfo"> <a href="/user" title="View &amp; edit your user profile">Logged in as manarth</a> <a href="/logout">Log out</a> </div> </div><!-- /#nav-masthead --> Cache
  • 40. Serving ESIs <div id="nav-masthead" class="grid-12"> <ul> <li class="homepage active first active"> <a href="/home" class="active active">Drupal Homepage</a> </li> <li class="dashboard last"> <a href="/user/dashboard">Your Dashboard</a> </li> </ul> Varnish Drupal <esisrc="http://example.com/esi/userinfo" /> </div><!-- /#nav-masthead --> Cache
  • 41. Serving ESIs <div id="userinfo"> <a href="/user" title="View &amp; edit your user profile">Logged in as manarth</a> <a href="/logout">Log out</a> </div> Varnish Drupal Cache
  • 42. What do you need in order to do ESIs? > Replace personalisationwith ESI tags Theme-alters? > Provide backend hook_menuhandlers for each ESI tag > Ensure that Varnish is caching > Rule 35 applies
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 50.
  • 51.
  • 52. Flickr Credits > Babbage engine http://www.flickr.com/photos/melgart/4444251 225 > Cookies http://www.flickr.com/photos/sabine01/24855 02578 > Frying wok http://www.flickr.com/photos/18403292@N00/ 3048993 > Varnish http://www.flickr.com/photos/dawniecakes/46 86467791

Notes de l'éditeur

  1. Back, to the dawn of the internet, when email was in fidonet and 56k modems were all the rage.
  2. Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache looks up from diskMight add some headersReturns the fileDodges the lolcat on the way back
  3. Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache recognises it&apos;s .php and passes to ModPHP straight awayModPHP looks up from diskHands to lexical parserProcessesReturns the file to apacheDodges the lolcat on the way back
  4. Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache processes .htaccess rulesEvery URL is index.phpPassed to ModPHP straight awayModPHP looks up from diskHands to lexical parserProcesses, invokes Drupal bootstrapReturns the file to apacheDodges the lolcat on the way back
  5. Benchmark:ApachePlain old PHP handler (no processing)Drupal
  6. Benchmark:ApachePlain old PHP handler (no processing)DrupalPHP parser adds 20%
  7. Refer to concepts such as baked vs fried
  8. Baked or fried?
  9. Prepared in advance No personalisation (more choc chips) Ready to eat
  10. One serving cooked at a time Wait a bit longer to eat Cooked freshPersonalised to taste
  11. - Looks at the hook_block information and uses appropriate cache rules – per user, etc.