SlideShare una empresa de Scribd logo
1 de 39
Accelerate your app with a 
layer of Varnish
Who?
●

●

●

Ex-pat Englishman, now living in Southern
Ontario.
Web developer for 5 years, mostly PHP.
(Almost) Senior Software Engineer at
TribeHR.

●

Co-organiser of Guelph PHP User Group.

●

Ex-professional musician.
Varnish can do incredible 
things for your app...
What is Varnish?
●

●

Open source caching reverse proxy or
HTTP accelerator.
Mature software:
–
–

●

Current version: 3.0.5
Varnish 4 currently in tech preview.

Used by 5% (500) of the top 10,000
sites on the internet.
Varnish basics
●

Listens on a port (normally 80).

●

When a request arrives:
–

–

●

If content is already in cache it is served
directly.
If not Varnish forwards the request to a
'backend' server, delivering the content
when it is received.

Only caches GET and HEAD requests.
Varnish features
●

●

●

Can cache any kind of content
delivered via HTTP.
Blazingly fast with incredible
performance.
Support for multiple backends and
basic load balancing.
Varnish features (cont)
●

●
●

●

Configuration through Varnish
Configuration Language (VCL).
Support for Edge Side Includes (ESI).
Behaviour can be extended through
Varnish Mods (VMODs).
Includes tools to monitor and tune
(varnishtop, varnishlog, varnishhist,
varnishstat, etc).
Show us the demo!

https://github.com/JCook21/VarnishDemo
Apache results
Varnish Results
Is Varnish always the right 
tool?
●

What kind of content are you serving?

●

Cookies.

●

SSL.

●

Varnish is like a layer of... varnish.

●

Do you really need Varnish?
Getting started with Varnish
Setting cache times
●

Two possible methods
–
–

●

HTTP cache headers
Directly in VCL

Prefer HTTP cache headers wherever
possible.
Supported OS's
●

Fully supported:
–
–

●

Linux
FreeBSD

'Try not to break':
–
–

OpenBSD

–
●

NetBSD
OS X

Needs a 64 bit OS ideally.
Installing Varnish
●

Use system package manager.
–

●

●

For Debian, Ubuntu and RedHat/CentOS
Varnish software maintains repositories
with up to date versions.

To obtain up to date version to install
on non-core supported platforms
compile from source.
More info at the Varnish website.
Basic configuration
●

●

Ships with an excellent, 'sane' default
VCL configuration.
To begin using Varnish:
–

Configure runtime options
(/etc/default/varnish).

–

Add one or more backends to VCL file
(/etc/varnish/default.vcl).
Adding VCL backends
●
●

●

Must add at least one backend in VCL.
If more than one, first will be the
default.
Backends can be grouped into
'directors' to apply load balancing.
Sample backend definition
backend default {
.host = "127.0.0.1";
.port = "8080";
}
Advanced configuration
Introduction to VCL
●

Provides a window into Varnish's state
during the request/response cycle.

●

Not a full programming language.

●

C/Perl-like syntax.

●

Compiled into a C shared object at
runtime and loaded into Varnish.
VCL Subroutines
●

●

Dispatched at different times in the
request/response cycle.
Each routine has default code:
–

Varnish appends this to the end of any code
you add.

–

Can be short-circuited by using the return
keyword. Be careful!

●

Allowed return values documentation.

●

You can also define your own.
VCL Subroutines (cont)
●

vcl_init

●

vcl_miss

●

vcl_recv

●

vcl_fetch

●

vcl_pipe

●

vcl_deliver

●

vcl_pass

●

vcl_error

●

vcl_hash

●

vcl_fini

●

vcl_hit
VCL Processing Cycle
VCL Functions
●

Functions Varnish makes available to you:
–
–

regsub(str, regex, sub)

–

regsuball(str, regex, sub)

–

ban(ban expression)

–

ban_url(regex) (Deprecated)

–

purge()

–
●

hash_data(str)

return()

Also have set and unset keywords to manipulate
variables and call to dispatch your own subroutines.
vcl_recv
●

●

Called once the OS kernel has given
the complete request to Varnish.
Typical uses:
–

Set the backend to use.

–

Amend the request.

–

Add extra information to the request.

–

Force a bypass of cache lookups (pass or
pipe).
vcl_fetch
●

●

Called when a response is received
from a backend, before it is considered
for inclusion in the cache.
Typical uses:
–

Amend or set a TTL.

–

Add or remove HTTP headers.

–

Detect errors (more later).

–

Turn on ESI processing.
Select a backend
backend default {
.host = "192.168.2.1";
.port = "8080";
}
backend bar {
.host = "192.168.2.2";
.port = "8080":
}
sub vcl_recv {
if (req.http.host ~ "bar.com") {
set req.backend = bar;
}
// etc
}
Remove cookies
sub vcl_recv {
if (req.url !~ "^/admin/.*") {
unset req.http.cookie;
}
}
sub vcl_fetch {
if (req.url !~ "^/admin/.*") {
unset beresp.http.set-cookie;
}
}
Set default TTL
sub vcl_fetch {
if (! beresp.http.cache-control &&
beresp.http.content-type ~ "text/html|
text/xml|application/json") {
set beresp.ttl = 5m;
}
}
VMOD's
●

Allow you to extend Varnish's features.

●

Written in C.

●

●

Community VMOD's at
https://www.varnish-cache.org/vmods
Examples:
–

Geo-IP lookup (BBC)

–

Query string normalisation

–

Memcache
Grace mode
●

●

●

Graced content is an object that has
expired but is kept in cache.
Grace mode is when a graced object is
used.
When this can happen:
–

No healthy backends are available.

–

Deliver old content while fetching new
content is pending.
Configuring grace
sub vcl_recv {
if (req.backend.healthy) {
set req.grace = 30s;
} else {
set req.grace = 1h;
}
}
sub vcl_fetch {
set beresp.grace = 1h;
}
Health checks
backend foo {
.host = "192.168.2.1";
.port = "8080";
.max_connections = 10;
.probe = {
.url = "/test";
.interval = 5s;
.timeout = 1s;
.window = 5;
.threshold = 3;
}
}
Saint mode
●

●

●

Allows you to say that a backend is
'sick' for one url.
Varnish will not make further requests
to that backend for the url for the time
specified.
Gives you a chance to detect errors in
responses.
Saint mode example
sub vcl_fetch {
if (beresp.status ~ “^5d{2}$”) {
set beresp.saintmode = 10s;
return(restart);
}
}
Edge Side Includes
●

●

Allows different content on the same
page to be cached for different times.
Request flow:
–

–

●

External request returns a page with special
ESI tags in it.
For each ESI tag Varnish issues a sub
request which generates the content.

Both 'master' and sub requests can be
cached.
Configuring ESI's
●

Done in vcl_fetch:
–

●

●

set beresp.do_esi = true;

Need to configure app to support
'layouts' and 'components'.
Various frameworks have support for
ESI's.
ESI Example
<!DOCTYPE html>
<html>
<head>
<title>ESI example</title>
</head>
<body>
<esi:include src="/route/to/content"/>
</body>
</html>
Thanks for listening!
●

Varnish docs:
https://www.varnish-cache.org/docs/3.0/tutorial/inde

●

Any questions?

●

Feel free to contact me:
–

@JCook21

–

jeremycook0@gmail.com

Más contenido relacionado

La actualidad más candente

getting started with varnish
getting started with varnishgetting started with varnish
getting started with varnishVarnish Software
 
Perforce Administration: Optimization, Scalability, Availability and Reliability
Perforce Administration: Optimization, Scalability, Availability and ReliabilityPerforce Administration: Optimization, Scalability, Availability and Reliability
Perforce Administration: Optimization, Scalability, Availability and ReliabilityPerforce
 
Introduction to Varnish VCL
Introduction to Varnish VCLIntroduction to Varnish VCL
Introduction to Varnish VCLPax Dickinson
 
Load Balancing with Nginx
Load Balancing with NginxLoad Balancing with Nginx
Load Balancing with NginxMarian Marinov
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX, Inc.
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleAmit Aggarwal
 
CRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationCRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationTomasz Rękawek
 
Making distributed storage easy: usability in Ceph Luminous and beyond
Making distributed storage easy: usability in Ceph Luminous and beyondMaking distributed storage easy: usability in Ceph Luminous and beyond
Making distributed storage easy: usability in Ceph Luminous and beyondSage Weil
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by StepKim Stefan Lindholm
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance CachingNGINX, Inc.
 
Massively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPMassively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPDemin Yin
 
Gluster technical overview
Gluster technical overviewGluster technical overview
Gluster technical overviewGluster.org
 
GFProxy: Scaling the GlusterFS FUSE Client
GFProxy: Scaling the GlusterFS FUSE Client	GFProxy: Scaling the GlusterFS FUSE Client
GFProxy: Scaling the GlusterFS FUSE Client Gluster.org
 
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian GrodzickiPROIDEA
 
Extending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksExtending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksDominic Cleal
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + MemcachedFord AntiTrust
 
Web Server Load Balancer
Web Server Load BalancerWeb Server Load Balancer
Web Server Load BalancerMobME Technical
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101ConFoo
 
Caching with varnish
Caching with varnishCaching with varnish
Caching with varnish90kts
 

La actualidad más candente (20)

getting started with varnish
getting started with varnishgetting started with varnish
getting started with varnish
 
Perforce Administration: Optimization, Scalability, Availability and Reliability
Perforce Administration: Optimization, Scalability, Availability and ReliabilityPerforce Administration: Optimization, Scalability, Availability and Reliability
Perforce Administration: Optimization, Scalability, Availability and Reliability
 
Introduction to Varnish VCL
Introduction to Varnish VCLIntroduction to Varnish VCL
Introduction to Varnish VCL
 
Load Balancing with Nginx
Load Balancing with NginxLoad Balancing with Nginx
Load Balancing with Nginx
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With Example
 
CRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationCRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migration
 
Making distributed storage easy: usability in Ceph Luminous and beyond
Making distributed storage easy: usability in Ceph Luminous and beyondMaking distributed storage easy: usability in Ceph Luminous and beyond
Making distributed storage easy: usability in Ceph Luminous and beyond
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Massively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPMassively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHP
 
Gluster technical overview
Gluster technical overviewGluster technical overview
Gluster technical overview
 
GFProxy: Scaling the GlusterFS FUSE Client
GFProxy: Scaling the GlusterFS FUSE Client	GFProxy: Scaling the GlusterFS FUSE Client
GFProxy: Scaling the GlusterFS FUSE Client
 
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
 
Extending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksExtending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooks
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
Web Server Load Balancer
Web Server Load BalancerWeb Server Load Balancer
Web Server Load Balancer
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101
 
Caching with varnish
Caching with varnishCaching with varnish
Caching with varnish
 
Nginx dhruba mandal
Nginx dhruba mandalNginx dhruba mandal
Nginx dhruba mandal
 

Similar a Accelerate your web app with a layer of Varnish

Varnish Cache Plus. Random notes for wise web developers
Varnish Cache Plus. Random notes for wise web developersVarnish Cache Plus. Random notes for wise web developers
Varnish Cache Plus. Random notes for wise web developersCarlos Abalde
 
Caching with Varnish
Caching with VarnishCaching with Varnish
Caching with Varnishschoefmax
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sitesYann Malet
 
PHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hellPHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hellluis-ferro
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Justin Foell
 
Professional deployment
Professional deploymentProfessional deployment
Professional deploymentIvelina Dimova
 
T3DD12 Caching with Varnish
T3DD12 Caching with VarnishT3DD12 Caching with Varnish
T3DD12 Caching with VarnishAOE
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...OpenShift Origin
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSamantha Quiñones
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...Wong Hoi Sing Edison
 
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkFlorent Georges
 
June8 presentation
June8 presentationJune8 presentation
June8 presentationnicobn
 

Similar a Accelerate your web app with a layer of Varnish (20)

Varnish Cache Plus. Random notes for wise web developers
Varnish Cache Plus. Random notes for wise web developersVarnish Cache Plus. Random notes for wise web developers
Varnish Cache Plus. Random notes for wise web developers
 
Caching with Varnish
Caching with VarnishCaching with Varnish
Caching with Varnish
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sites
 
PHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hellPHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hell
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Varnish Cache
Varnish CacheVarnish Cache
Varnish Cache
 
Varnish
VarnishVarnish
Varnish
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)
 
Advanced LB
Advanced LBAdvanced LB
Advanced LB
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
T3DD12 Caching with Varnish
T3DD12 Caching with VarnishT3DD12 Caching with Varnish
T3DD12 Caching with Varnish
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9
 
Nginx pres
Nginx presNginx pres
Nginx pres
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
 
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
 
June8 presentation
June8 presentationJune8 presentation
June8 presentation
 

Más de Jeremy Cook

Unit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitUnit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitJeremy Cook
 
Tracking your data across the fourth dimension
Tracking your data across the fourth dimensionTracking your data across the fourth dimension
Tracking your data across the fourth dimensionJeremy Cook
 
Tracking your data across the fourth dimension
Tracking your data across the fourth dimensionTracking your data across the fourth dimension
Tracking your data across the fourth dimensionJeremy Cook
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to DomainJeremy Cook
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to DomainJeremy Cook
 
Track your data across the fourth dimension
Track your data across the fourth dimensionTrack your data across the fourth dimension
Track your data across the fourth dimensionJeremy Cook
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logsJeremy Cook
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logsJeremy Cook
 
PHPUnit: from zero to hero
PHPUnit: from zero to heroPHPUnit: from zero to hero
PHPUnit: from zero to heroJeremy Cook
 

Más de Jeremy Cook (9)

Unit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitUnit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnit
 
Tracking your data across the fourth dimension
Tracking your data across the fourth dimensionTracking your data across the fourth dimension
Tracking your data across the fourth dimension
 
Tracking your data across the fourth dimension
Tracking your data across the fourth dimensionTracking your data across the fourth dimension
Tracking your data across the fourth dimension
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to Domain
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to Domain
 
Track your data across the fourth dimension
Track your data across the fourth dimensionTrack your data across the fourth dimension
Track your data across the fourth dimension
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 
PHPUnit: from zero to hero
PHPUnit: from zero to heroPHPUnit: from zero to hero
PHPUnit: from zero to hero
 

Último

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Accelerate your web app with a layer of Varnish

Notas del editor

  1. Mention jaw dropping nature of it... Talk is an intro to what varnish is, what it can do and when it is (as well as is not) the right tool for the job.
  2. Explain what a caching reverse proxy is. Varnish users: BBC, Synacor, Slideshare, Facebook(?), Twitter(search), Forbes.com and NY Times. Mention that I have stories about how these organisations are using Varnish but no time...
  3. Varnish&amp;apos;s definition of a backend: any http server that can produce content that can potentially be cached. Safe http methods.
  4. Mention html, json, xml, css, javascript, images, media files, etc. Developers claim speed improvement of 300-1000x Dev&amp;apos;s also claim seeing Varnish deliver 20GBPS on off the shelf hardware... Claim that you will typically max out your internet connection before exhausting Varnish&amp;apos;s ability to serve content from cache.
  5. Mention some people have had problems under OSX.
  6. Varnish looks for value in s-maxage or maxage in cache-control. If neither set looks for Expires header. Then looks in VCL. If nothing set then uses the default_ttl runtime option. Can be overridden in VCL. Varnish ignores request cache headers. Will only cache: 200: OK 203: Non-Authoritative Information 300: Multiple Choices 301: Moved Permanently 302: Moved Temporarily 307: Temporary Redirect 410: Gone 404: Not Found
  7. Mention that 32 bit installs of supported versions are possible but limited memory. If your app runs on another OS there&amp;apos;s nothing to stop you putting Varnish in front of it on a supported OS...
  8. Lego analogy. -a port Varnish listens on. -f VCL file -s type and size of storage Mention that runtime options are passed to varnishd whent started, normally set in defaults file.
  9. Mention that VCL allows you to decide which backend to use when a request is received. Also mention Varnish supports several types of load balancing.
  10. Mention that issuing Varnish reload simply reloads the config. Server not stopped so cache not purged. Existing items in cache will keep the existing cache time! Reload does nothing if VCL invalid, which is good... Mention no support for user variables or loops.
  11. Note that you can&amp;apos;t pass arguments to subroutines in VCL.
  12. Only give an overview!!
  13. Also mention pipe along with pass.
  14. hash_data: adds a string to the hash input. regsub: replaces first regex match with the sub regsuball: replaces all regex matches with sub ban: bans all objects in cache that match the expression. ban_url: bans all objects in cache that match the regex. DEPRECATED. Ban is a filter on objects in the cache. Ban things from being served from cache but doesn&amp;apos;t stop new items entering the cache.
  15. Mention that Varnish will set a ttl before this subroutine is called.
  16. Note that this example is overly simplistic!
  17. Varnish queues multiple requests for the same content. Allows Varnish to stop requests for content piling up while fetching content from a backend. To use graced content for unhealthy backends health checks must be set.
  18. Configure req.grace in vcl_recv and beresp.grace in vcl_fetch. req.grace can be set dynamically depending on the health of a backend. Typically store an object for several hours past ttl. Only use it for a few seconds past the ttl unless the backend is sick.
  19. Configured with url, interval, window, threshold. Interval is how often to probe. Threshold and window set limits, eg. Threshold probes must pass in window probes.
  20. Used to mark a single object on a single backend as sick for a period of time. If n (default 10) objects are marked as sick whole backend will be marked as sick. Can trigger grace mode.
  21. Note that Varnish does not implement the complete ESI specification.
  22. Mention SF2 native support for ESI.