1
Ultimate Goal and Problem
Network LatencyThroughput
2
Varnish Extend - What is it?
Bundled Software and Services
Aimed to provide
● Flexible deployment methodology for Varnish and other delivery mechanisms
● A set of tools that enables easy “hybridisation” of technologies
Example use cases:
- Hybrid CDN/Varnish
- Leverage existing data centres for content delivery
- Full DIY CDN
3
Three Key Components
Varnish Plus (caching)
● Fine-grained cache control important for good off-loads
● High availability
● Custom Statistics - Visibility of near real-time reporting
Cedexis Radar/Openmix (RUM based Intelligent Routing and GSLB)
● Move beyond Geo to End-User Feedback
● “Programmable” load-balancing to enable flexibility and fine-grained control
Cedexis Purge (Unified Purging)
● Purge Page and object Content Across delivery architectures.
● Purge Method Supported (No Bans) 4
Varnish Extend
Extending your Content Delivery Capabilities and Control
Private CDN /
Edge node(s)
End UsersAccess
Network
CDN
Operators
Content Origin Global Traffic
Management
5
● Overall depicted edge capacity
is 80Gbps (8 x 10Gbps).
● DNS based edge routing allows
clients to pin to an edge node,
making prefetch effective.
● Both tiers can scale horizontally
by adding more nodes,
increasing overall storage and
capacity.
● Live video content is malloc
only.
● Edge and storage tiers can live
in the same rack.
6
Varnish Custom Statistics (VCS)
7
Cedexis
Radar Real-user Monitoring (RUM)
- Tag Based.
- Community Testing of CDN’s and Clouds
- Monitoring of Data Centres
Openmix Load-Balancing
- Programmable “Business logic” Load-Balancing
- JS based / Forms based configuration
- ECMA5 (Some 6)
- DNS Decisions
- CNAME / A/AAAA Record Responses
- TTL
- HTTP API
- “Decisions” in a restful response
- Multi-Decision responses (ordered lists)
8
Prerequisites
● Basic experience with command line in Linux/Unix systems
● Basic understanding of Varnish Configuration Language (VCL)
● Varnish Extend subscription
● Root access to virtual or real hosts. In this demo:
○ Origin server
○ POPs
● Access to your DNS Architecture 9
Design
Image:
https://media.licdn.com/
mpr/mpr/shrinknp_800_8
00/p/5/005/0b0/060/2590
45e.jpg
10
Edge 3
Location: Asia
Edge 2
Location: Europe
Varnish Plus
Edge 1
Location: U.S.
Varnish Plus
Location: NYC
Origin Server
Varnish Plus
Tier 2: POPsTier 1: Shield
Varnish PlusVarnish Plus
VHA
Demo
11
Implementation 12
13
TLS configuration
● Repository configuration for
○ varnish-plus-addon-ssl
● Certificate:
○ From valid certification authority
○ Let’s Encrypt
○ make-dummy-cert
● VCL to connect from POPs to origin server:
backend default {
.host = "origin-frankfurt.varnish-software.com";
.port = "https";
.ssl = 1;
.ssl_nosni = 1;
.ssl_noverify = 1;
}
14
Hitch configuration
/etc/hitch/hitch.conf
frontend = "[*]:443"
backend = "[127.0.0.1]:6086"
pem-file = "/etc/ssl/bundles/varnish-software.com.bundle"
write-proxy-v1 = on
...
$ service hitch start
15
Massive Storage Engine (MSE)
$ mkfs.mse -s /var/lib/varnish/mse/store,5GB 
-b /var/lib/varnish/mse/book,50MB -p big_alloc=5MB
Creating data stores in file '/var/varnish/mse/store'
Cooking the books in file '/var/lib/varnish/mse/book'. This may take a
while ...
Creating 209661 spare nodes
Creating 209661 spare nodes
Finished
Varnish Plus Massive Storage Engine data files successfully created.
Varnish Plus stevedore argument:
varnishd -s mse, /var/lib/varnish/mse/store,/var/lib/varnish/mse/book
16
VCS Configuration
sub vcl_deliver {
std.log("vcs-key:ALL");
std.log("vcs-key:HOST/" + req.http.Host);
std.log("vcs-key:URL/" + req.http.Host + req.url);
std.log("vcs-key:CONTENT/" + req.http.Host + "/" +
regsub(resp.http.Content-Type, ";.*", ""));
std.log("vcs-key:SESSIONS/" + req.http.veid);
}
/etc/varnish/cdn.vcl
DAEMON_OPTS="138.197.97.165"
/etc/varnish/vstatdprobe.params
17
Cedexis Configuration: Radar
Radar
- Deploy “tag” in Web pages to start
testing
- Place “Test-Objects” to test each
deployment (Server/Cluster)
- Configure Cedexis Portal to Monitor
18
Cedexis: Configuring Openmix
Decide on HTTP or DNS “Decisions”
Create Application
- Forms Driven (Portal)
- Custom JS (ECMA5)
- Common Code base for HTTP and DNS.
- http://developers.cedexis.com
Deploy
- Via Portal “2 Stage” Publish
Go-Live
- DNS - CNAME to Cedexis host (2-01-5024-
0003.cdx.cedexis.net)
- HTTP - Integrate API into a CMS or Player.
19
Demo
20
Take away
● Building your private CDN is not rocket science with Varnish Extend
● Roll it out gradually: keep risks controlled and low!
● Gain consumer power by combining Varnish and CDN offerings
● Gain control on the delivery of your content with minimum overhead and
complexity
● Maximize hardware resource utilization
21
22
Varnish High Availability (VHA)
Varnish 1
VHA
Varnish 2
VHA
1
2
3
4
5
6
7
8
Client
1. Client request
2. Backend request
3. Backend response
4. VHA notices a new cached
object
1. Client response
2. Signals replication request
3. Peer request
4. Peer response
5. Object replicated
9
Backend
23
Varnish High Availability (VHA)
sub vcl_recv {
call vha_backend_selection;
}
sub vcl_hit {
call vha_skip_grace;
}
sub vcl_deliver {
call vha_clean_headers;
}
/etc/varnish/cdn.vcl
$ vha-generate-vcl --token 9ad34eccb > /etc/varnish/vha.vcl
24
Varnish High Availability (VHA)
ENABLE=1
NAME=singapore-01
DAEMON_OPTS="-N /etc/varnish/nodes.conf -m singapore-01 
-s /var/lib/vha-agent/vha-status -T 9ad34eccb"
vha-agent.params
singapore-01 = https://cdn-singapore-01.varnish-software.com
singapore-02 = https://cdn-singapore-02.varnish-software.com
/etc/varnish/nodes.conf
25
Numerous Possibilities for Load-Balancing
26
Extending Intelligence with Fusion
- A Service that takes 3rd Party Data for use
within an Openmix Application
- Pre-built Interfaces with:
- CDN’s
- APM (Monitoring)
- Server Architectures
- Can pull Bandwidth, Usage etc from suppliers
- Custom ingest also possible with Fusion
Custom (Anything text based)
- Business Metrics like cost, commit
- Custom Technical Metrics
27
DNS or HTTP
DNS
- Common Method of Integration for
WebSites/Applications
- DNS CNAME integration
- Decision made at Resolver Level
- Fully Transparent to end-user.
HTTP
- Usually used for Video
- API based Integration
- Points to “Best” delivery Architecture
- Ordered List or Single Provider response
- Decision Made at requestor (Client) IP level.
28
Test material
● DASH player from https://github.com/Dash-Industry-Forum/dash.js/
● DASH videos from http://dash.edgesuite.net/dash264/TestCases/5a/
● Player Demo: https://cdn.varnish-software.com/dash.js/samples/dash-if-
reference-player/
● Load-balancing script examples: developers.cedexis.com
29

Varnish extend

  • 1.
  • 2.
    Ultimate Goal andProblem Network LatencyThroughput 2
  • 3.
    Varnish Extend -What is it? Bundled Software and Services Aimed to provide ● Flexible deployment methodology for Varnish and other delivery mechanisms ● A set of tools that enables easy “hybridisation” of technologies Example use cases: - Hybrid CDN/Varnish - Leverage existing data centres for content delivery - Full DIY CDN 3
  • 4.
    Three Key Components VarnishPlus (caching) ● Fine-grained cache control important for good off-loads ● High availability ● Custom Statistics - Visibility of near real-time reporting Cedexis Radar/Openmix (RUM based Intelligent Routing and GSLB) ● Move beyond Geo to End-User Feedback ● “Programmable” load-balancing to enable flexibility and fine-grained control Cedexis Purge (Unified Purging) ● Purge Page and object Content Across delivery architectures. ● Purge Method Supported (No Bans) 4
  • 5.
    Varnish Extend Extending yourContent Delivery Capabilities and Control Private CDN / Edge node(s) End UsersAccess Network CDN Operators Content Origin Global Traffic Management 5
  • 6.
    ● Overall depictededge capacity is 80Gbps (8 x 10Gbps). ● DNS based edge routing allows clients to pin to an edge node, making prefetch effective. ● Both tiers can scale horizontally by adding more nodes, increasing overall storage and capacity. ● Live video content is malloc only. ● Edge and storage tiers can live in the same rack. 6
  • 7.
  • 8.
    Cedexis Radar Real-user Monitoring(RUM) - Tag Based. - Community Testing of CDN’s and Clouds - Monitoring of Data Centres Openmix Load-Balancing - Programmable “Business logic” Load-Balancing - JS based / Forms based configuration - ECMA5 (Some 6) - DNS Decisions - CNAME / A/AAAA Record Responses - TTL - HTTP API - “Decisions” in a restful response - Multi-Decision responses (ordered lists) 8
  • 9.
    Prerequisites ● Basic experiencewith command line in Linux/Unix systems ● Basic understanding of Varnish Configuration Language (VCL) ● Varnish Extend subscription ● Root access to virtual or real hosts. In this demo: ○ Origin server ○ POPs ● Access to your DNS Architecture 9
  • 10.
  • 11.
    Edge 3 Location: Asia Edge2 Location: Europe Varnish Plus Edge 1 Location: U.S. Varnish Plus Location: NYC Origin Server Varnish Plus Tier 2: POPsTier 1: Shield Varnish PlusVarnish Plus VHA Demo 11
  • 12.
  • 13.
  • 14.
    TLS configuration ● Repositoryconfiguration for ○ varnish-plus-addon-ssl ● Certificate: ○ From valid certification authority ○ Let’s Encrypt ○ make-dummy-cert ● VCL to connect from POPs to origin server: backend default { .host = "origin-frankfurt.varnish-software.com"; .port = "https"; .ssl = 1; .ssl_nosni = 1; .ssl_noverify = 1; } 14
  • 15.
    Hitch configuration /etc/hitch/hitch.conf frontend ="[*]:443" backend = "[127.0.0.1]:6086" pem-file = "/etc/ssl/bundles/varnish-software.com.bundle" write-proxy-v1 = on ... $ service hitch start 15
  • 16.
    Massive Storage Engine(MSE) $ mkfs.mse -s /var/lib/varnish/mse/store,5GB -b /var/lib/varnish/mse/book,50MB -p big_alloc=5MB Creating data stores in file '/var/varnish/mse/store' Cooking the books in file '/var/lib/varnish/mse/book'. This may take a while ... Creating 209661 spare nodes Creating 209661 spare nodes Finished Varnish Plus Massive Storage Engine data files successfully created. Varnish Plus stevedore argument: varnishd -s mse, /var/lib/varnish/mse/store,/var/lib/varnish/mse/book 16
  • 17.
    VCS Configuration sub vcl_deliver{ std.log("vcs-key:ALL"); std.log("vcs-key:HOST/" + req.http.Host); std.log("vcs-key:URL/" + req.http.Host + req.url); std.log("vcs-key:CONTENT/" + req.http.Host + "/" + regsub(resp.http.Content-Type, ";.*", "")); std.log("vcs-key:SESSIONS/" + req.http.veid); } /etc/varnish/cdn.vcl DAEMON_OPTS="138.197.97.165" /etc/varnish/vstatdprobe.params 17
  • 18.
    Cedexis Configuration: Radar Radar -Deploy “tag” in Web pages to start testing - Place “Test-Objects” to test each deployment (Server/Cluster) - Configure Cedexis Portal to Monitor 18
  • 19.
    Cedexis: Configuring Openmix Decideon HTTP or DNS “Decisions” Create Application - Forms Driven (Portal) - Custom JS (ECMA5) - Common Code base for HTTP and DNS. - http://developers.cedexis.com Deploy - Via Portal “2 Stage” Publish Go-Live - DNS - CNAME to Cedexis host (2-01-5024- 0003.cdx.cedexis.net) - HTTP - Integrate API into a CMS or Player. 19
  • 20.
  • 21.
    Take away ● Buildingyour private CDN is not rocket science with Varnish Extend ● Roll it out gradually: keep risks controlled and low! ● Gain consumer power by combining Varnish and CDN offerings ● Gain control on the delivery of your content with minimum overhead and complexity ● Maximize hardware resource utilization 21
  • 22.
  • 23.
    Varnish High Availability(VHA) Varnish 1 VHA Varnish 2 VHA 1 2 3 4 5 6 7 8 Client 1. Client request 2. Backend request 3. Backend response 4. VHA notices a new cached object 1. Client response 2. Signals replication request 3. Peer request 4. Peer response 5. Object replicated 9 Backend 23
  • 24.
    Varnish High Availability(VHA) sub vcl_recv { call vha_backend_selection; } sub vcl_hit { call vha_skip_grace; } sub vcl_deliver { call vha_clean_headers; } /etc/varnish/cdn.vcl $ vha-generate-vcl --token 9ad34eccb > /etc/varnish/vha.vcl 24
  • 25.
    Varnish High Availability(VHA) ENABLE=1 NAME=singapore-01 DAEMON_OPTS="-N /etc/varnish/nodes.conf -m singapore-01 -s /var/lib/vha-agent/vha-status -T 9ad34eccb" vha-agent.params singapore-01 = https://cdn-singapore-01.varnish-software.com singapore-02 = https://cdn-singapore-02.varnish-software.com /etc/varnish/nodes.conf 25
  • 26.
    Numerous Possibilities forLoad-Balancing 26
  • 27.
    Extending Intelligence withFusion - A Service that takes 3rd Party Data for use within an Openmix Application - Pre-built Interfaces with: - CDN’s - APM (Monitoring) - Server Architectures - Can pull Bandwidth, Usage etc from suppliers - Custom ingest also possible with Fusion Custom (Anything text based) - Business Metrics like cost, commit - Custom Technical Metrics 27
  • 28.
    DNS or HTTP DNS -Common Method of Integration for WebSites/Applications - DNS CNAME integration - Decision made at Resolver Level - Fully Transparent to end-user. HTTP - Usually used for Video - API based Integration - Points to “Best” delivery Architecture - Ordered List or Single Provider response - Decision Made at requestor (Client) IP level. 28
  • 29.
    Test material ● DASHplayer from https://github.com/Dash-Industry-Forum/dash.js/ ● DASH videos from http://dash.edgesuite.net/dash264/TestCases/5a/ ● Player Demo: https://cdn.varnish-software.com/dash.js/samples/dash-if- reference-player/ ● Load-balancing script examples: developers.cedexis.com 29