Varnish Cache 4.0
Whats new
Varnish 3.0
• Released in 2011	

• Added modules	

• gzip	

• basic streaming capabilities
Security inV4
• -r for read only parameters	

• Locks down CLI	

• user, group and cc_command	

• Inline C is default off
Threading inVarnish 4
Client

thread
Backend
thread
Varnish Cache
Client Web 

server
Varnish Cache
Grace inV4
Client

thread
Backend
thread
Client Web 

server
GET /stale-object
Varnish Cache
Grace inV4
Client

thread
Backend
thread
Client Web 

serverStale object 

delivered
Background fetch
schedu...
Varnish Cache
Grace inV4
Client

thread
Backend
thread
Client Web 

server
Object refreshed
Streaming
• V3 will add a bit of delay before starting delivery
on cache misses	

• From “store and forward” to “cut throu...
Streaming inVarnish
Backend
thread
Varnish Cache
Web 

server
Client
Client

thread
Client
Client

thread
Client
Client

t...
Upcoming inV4 Plus
• New storage backend	

• Supports >1TB of storage	

• Persists cache across crash/reboot	

• Highly pe...
Logging inV3
• Logging inV3 is limited	

• Only regex matching using &&	

• No req/bereq relationship	

• Performance prob...
• Transactions and transactions groups	

• Query language	

• Output control	

• Increased performance (zero copy)
Logging...
Log transactions
• On work item forVarnish	

• client request	

• backend request	

• ESI sub-request	

• session
Transactions groups
• Transactions (work items) can be grouped	

• byVXID	

• by request	

• by session	

• raw	

varnishl...
Log query language
"
$ varnishlog -g request 
-q 'ReqURL eq "/"'
"
"
"
$ varnishlog -g request 
-q 'Backend ~ default'
* <...
Examples
"
String matching, negation, logical operations	

not (RespProtocol eq “HTTP/1.1”) or (RespProtcol
eq “HTTP/1.0”)...
Mind blown?
Output control
• A bit like “grep” for varnishlog	

• Applied last, doesn’t affect queries	

• -i <taglist> / -I <taglist:...
Load balancing
• Mostly feature parity… however	

• Directors areVMODs now	

• Directors typically defined in vcl_init	

• ...
Summing up
• Streaming is much improved inV4	

• New mind blowing logging facility	

• Backend/frontend threading	

• IMS ...
Other neat stuff
• Auto-tuner coming toVarnish Cache Plus	

• Clustering forVarnish Cache Plus	

• Real time analytics (VC...
Thank you!

perbu@varnish-software.com

twitter.com/perbu
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo
Upcoming SlideShare
Loading in …5
×

Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo

873 views

Published on

Whats new in Varnish Cache 4.0. Threads, streaming, logging.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
873
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Varnish Cache 4.0 / Redpill Linpro breakfast in Oslo

  1. 1. Varnish Cache 4.0 Whats new
  2. 2. Varnish 3.0 • Released in 2011 • Added modules • gzip • basic streaming capabilities
  3. 3. Security inV4 • -r for read only parameters • Locks down CLI • user, group and cc_command • Inline C is default off
  4. 4. Threading inVarnish 4 Client
 thread Backend thread Varnish Cache Client Web 
 server
  5. 5. Varnish Cache Grace inV4 Client
 thread Backend thread Client Web 
 server GET /stale-object
  6. 6. Varnish Cache Grace inV4 Client
 thread Backend thread Client Web 
 serverStale object 
 delivered Background fetch scheduled
  7. 7. Varnish Cache Grace inV4 Client
 thread Backend thread Client Web 
 server Object refreshed
  8. 8. Streaming • V3 will add a bit of delay before starting delivery on cache misses • From “store and forward” to “cut through” • Set do_stream = true inV4 • Beneficial for large objects and cache hierarchies
  9. 9. Streaming inVarnish Backend thread Varnish Cache Web 
 server Client Client
 thread Client Client
 thread Client Client
 thread GET /big-object-to-be-streamed
  10. 10. Upcoming inV4 Plus • New storage backend • Supports >1TB of storage • Persists cache across crash/reboot • Highly performant on SSDs • Only available inVarnish Plus
  11. 11. Logging inV3 • Logging inV3 is limited • Only regex matching using && • No req/bereq relationship • Performance problems
  12. 12. • Transactions and transactions groups • Query language • Output control • Increased performance (zero copy) Logging inV4
  13. 13. Log transactions • On work item forVarnish • client request • backend request • ESI sub-request • session
  14. 14. Transactions groups • Transactions (work items) can be grouped • byVXID • by request • by session • raw varnishlog -g (vxid | request | session | raw )
  15. 15. Log query language " $ varnishlog -g request -q 'ReqURL eq "/"' " " " $ varnishlog -g request -q 'Backend ~ default' * << Request >> 32770 
 - Begin req 32769
 - ReqMethod GET- ReqURL /- ReqProtocol HTTP/1.1
 - ReqHeader TE: deflate,gzip;q=0.3 ... - Link bereq 32771
 - VCL_call DELIVER
 - VCL_return deliver
 - RespProtocol HTTP/1.1
 - RespStatus 200
 - RespResponse OK
 - ReqEnd 1385330985.979025126 1385330985.978960991 -0.001315594 0.001251459 -0.001315594
 - End 
 ** << BeReq >> 32771 
 -- Begin bereq 32770
 -- VCL_call BACKEND_FETCH
 -- VCL_return fetch
 -- BackendOpen 18 default(127.0.0.1,::1,8020) 127.0.0.1 45989 -- Backend 18 default default(127.0.0.1,::1,8020)
 -- BereqMethod GET
 -- BereqURL /
 -- BereqEnd 1385330985.979187250 1385330985.980367422 0.000082792 0.000496101 0.000326045 0.000822146
 -- End
  16. 16. Examples " String matching, negation, logical operations not (RespProtocol eq “HTTP/1.1”) or (RespProtcol eq “HTTP/1.0”))! Regular expressions ! ReqMethod !~ "GET|POST"! Integer matching ! (RespStatus >= 200 and RespStatus < 300)! Float matching ! Timestamp:Process[2] > 0.5
  17. 17. Mind blown?
  18. 18. Output control • A bit like “grep” for varnishlog • Applied last, doesn’t affect queries • -i <taglist> / -I <taglist:regex> • -x <taglist> / -X <taglist:regex> • Taglists supports globbing (e.g. Req*)
  19. 19. Load balancing • Mostly feature parity… however • Directors areVMODs now • Directors typically defined in vcl_init • Easy to implement new directors • Directors are now stackable
  20. 20. Summing up • Streaming is much improved inV4 • New mind blowing logging facility • Backend/frontend threading • IMS towards backend • Performance increase • VCL changes • Reworked documentation (varnish.org/docs)
  21. 21. Other neat stuff • Auto-tuner coming toVarnish Cache Plus • Clustering forVarnish Cache Plus • Real time analytics (VCS)
  22. 22. Thank you!
 perbu@varnish-software.com
 twitter.com/perbu

×