© 2017 Magento, Inc. Page | 2
Monitoring your cache
effectiveness in
Magento 2
© 2017 Magento, Inc. Page | 3
Tony Brown
Technical Director, Space 48
@Tonegolf71
@Space48ers
© 2017 Magento, Inc. Page | 4
Tony Brown
Technical Director, Space 48
@Tonegolf71
@Space48ers
@MageTitans
© 2017 Magento, Inc. Page |
Remember…
• Full Page Cache (FPC) is not an
excuse to have slow PHP /
Magento code
5
M2 FPC
© 2017 Magento, Inc. Page |
Varnish
7
Client Varnish Server
Client Varnish Server
Request
Request
Response Response
Cache-Miss
Cache-Hit, response
© 2017 Magento, Inc. Page |
• Natively faster with Varnish
• Now in CE and EE
• Building to work with one FPC
• Core improvements benefit everyone
Advantages over Core M1 FPC
8
© 2017 Magento, Inc. Page |
• Reduce requests reaching the full app to a minimum
• Only invalidate data when absolutely necessary and keep impact of
invalidation to a minimum
Optimal FPC Performance
9
More HITS
Less MISSES
In Other Words…
The challenge is how..?
© 2017 Magento, Inc. Page |
• Varnish config file and M2 core modules
• Tag support
• Method for handling private data on a page
• Method for independently cacheable elements
M2 FPC
12
© 2017 Magento, Inc. Page |
Why is FPC effectiveness important?
13
© 2017 Magento, Inc. Page |
• Bad performance hurts conversion!!!
Why is FPC effectiveness important?
14
© 2017 Magento, Inc. Page |
• Varnish command-line tools
• varnishstat
• varnishtop
• varnishlog
How do we know?
15
How can we easily monitor
FPC effectiveness?
© 2017 Magento, Inc. Page |
@maxpchadwick
http://maxchadwick.xyz
Something Digital
Mpchadwick_PageCacheHitRate
: https://goo.gl/oWJZ0w
Magento 1 Module
17
© 2017 Magento, Inc. Page |
• time
• url
• hit, miss (or partial)
• route
• plus more
M1 Module: Log Data
18
© 2017 Magento, Inc. Page |19
© 2017 Magento, Inc. Page |20
Can we use the same
approach?
© 2017 Magento, Inc. Page |
In Short… No
22
Client Varnish Server
Client Varnish Server
Request
Request
Response Response
Cache-Miss
Cache-Hit, response
But we can do something
similar!
© 2017 Magento, Inc. Page |
• varnishncsa
• Display Varnish logs in Apache / NCSA combined log format
• Format can be customised
• Can include Varnish extended variables
M2 FPC monitoring
24
© 2017 Magento, Inc. Page |
• time
• hit, miss
• url
M2 FPC monitoring
25
© 2017 Magento, Inc. Page |
• We will get data for all requests including static assets
• We are missing the route of the Magento Controller
Two Challenges
26
© 2017 Magento, Inc. Page |
Add the route as a header
27
X-Magento-Full-Action-Name | cms_index_index
© 2017 Magento, Inc. Page |28
© 2017 Magento, Inc. Page |
• time
• hit, miss
• route
• url
M2 FPC monitoring
29
© 2017 Magento, Inc. Page |
Add the route as a header
30
X-Magento-Full-Action-Name | cms_index_index
© 2017 Magento, Inc. Page |31
Some Examples
Can you guess what is
going wrong?
© 2017 Magento, Inc. Page |34
© 2017 Magento, Inc. Page |35
Beware of
cacheable=“false”
© 2017 Magento, Inc. Page |37
Beware of crazy admin
users!
© 2017 Magento, Inc. Page |
• Native New Relic Magento Varnish plugin!
• What else could we report on that is valuable?
• Data being invalidated, too broad or frequently?
What next?
39
© 2017 Magento, Inc. Page |
Thank you!
40
© 2017 Magento, Inc. Page |
Thank you!
41
© 2017 Magento, Inc. Page |
• Any Questions?
Thank you!
42
Sat 11th Nov 2017
@MageTitans
Don’t miss it!
Manchester

Monitoring your cache effectiveness in Magento 2

  • 2.
    © 2017 Magento,Inc. Page | 2 Monitoring your cache effectiveness in Magento 2
  • 3.
    © 2017 Magento,Inc. Page | 3 Tony Brown Technical Director, Space 48 @Tonegolf71 @Space48ers
  • 4.
    © 2017 Magento,Inc. Page | 4 Tony Brown Technical Director, Space 48 @Tonegolf71 @Space48ers @MageTitans
  • 5.
    © 2017 Magento,Inc. Page | Remember… • Full Page Cache (FPC) is not an excuse to have slow PHP / Magento code 5
  • 6.
  • 7.
    © 2017 Magento,Inc. Page | Varnish 7 Client Varnish Server Client Varnish Server Request Request Response Response Cache-Miss Cache-Hit, response
  • 8.
    © 2017 Magento,Inc. Page | • Natively faster with Varnish • Now in CE and EE • Building to work with one FPC • Core improvements benefit everyone Advantages over Core M1 FPC 8
  • 9.
    © 2017 Magento,Inc. Page | • Reduce requests reaching the full app to a minimum • Only invalidate data when absolutely necessary and keep impact of invalidation to a minimum Optimal FPC Performance 9
  • 10.
  • 11.
  • 12.
    © 2017 Magento,Inc. Page | • Varnish config file and M2 core modules • Tag support • Method for handling private data on a page • Method for independently cacheable elements M2 FPC 12
  • 13.
    © 2017 Magento,Inc. Page | Why is FPC effectiveness important? 13
  • 14.
    © 2017 Magento,Inc. Page | • Bad performance hurts conversion!!! Why is FPC effectiveness important? 14
  • 15.
    © 2017 Magento,Inc. Page | • Varnish command-line tools • varnishstat • varnishtop • varnishlog How do we know? 15
  • 16.
    How can weeasily monitor FPC effectiveness?
  • 17.
    © 2017 Magento,Inc. Page | @maxpchadwick http://maxchadwick.xyz Something Digital Mpchadwick_PageCacheHitRate : https://goo.gl/oWJZ0w Magento 1 Module 17
  • 18.
    © 2017 Magento,Inc. Page | • time • url • hit, miss (or partial) • route • plus more M1 Module: Log Data 18
  • 19.
    © 2017 Magento,Inc. Page |19
  • 20.
    © 2017 Magento,Inc. Page |20
  • 21.
    Can we usethe same approach?
  • 22.
    © 2017 Magento,Inc. Page | In Short… No 22 Client Varnish Server Client Varnish Server Request Request Response Response Cache-Miss Cache-Hit, response
  • 23.
    But we cando something similar!
  • 24.
    © 2017 Magento,Inc. Page | • varnishncsa • Display Varnish logs in Apache / NCSA combined log format • Format can be customised • Can include Varnish extended variables M2 FPC monitoring 24
  • 25.
    © 2017 Magento,Inc. Page | • time • hit, miss • url M2 FPC monitoring 25
  • 26.
    © 2017 Magento,Inc. Page | • We will get data for all requests including static assets • We are missing the route of the Magento Controller Two Challenges 26
  • 27.
    © 2017 Magento,Inc. Page | Add the route as a header 27 X-Magento-Full-Action-Name | cms_index_index
  • 28.
    © 2017 Magento,Inc. Page |28
  • 29.
    © 2017 Magento,Inc. Page | • time • hit, miss • route • url M2 FPC monitoring 29
  • 30.
    © 2017 Magento,Inc. Page | Add the route as a header 30 X-Magento-Full-Action-Name | cms_index_index
  • 31.
    © 2017 Magento,Inc. Page |31
  • 32.
  • 33.
    Can you guesswhat is going wrong?
  • 34.
    © 2017 Magento,Inc. Page |34
  • 35.
    © 2017 Magento,Inc. Page |35
  • 36.
  • 37.
    © 2017 Magento,Inc. Page |37
  • 38.
    Beware of crazyadmin users!
  • 39.
    © 2017 Magento,Inc. Page | • Native New Relic Magento Varnish plugin! • What else could we report on that is valuable? • Data being invalidated, too broad or frequently? What next? 39
  • 40.
    © 2017 Magento,Inc. Page | Thank you! 40
  • 41.
    © 2017 Magento,Inc. Page | Thank you! 41
  • 42.
    © 2017 Magento,Inc. Page | • Any Questions? Thank you! 42 Sat 11th Nov 2017 @MageTitans Don’t miss it! Manchester