SlideShare a Scribd company logo
Speed up your data caches with Heisencache
Frédéric G. Marand
3/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS
IMPLEMENTATION
MEASURING
CONTEXT
4/59 | heisencache-15D17 | © OSInet
Frederic MARAND
Perception
●
Front-end dominates
●
Downloads start after the page is served
●
Not all sites are equal when it comes to the
back/front performance ratio
CONTEXT
5/59 | heisencache-15D17 | © OSInet
Frederic MARANDwww.webpagetest.org
Major press site example:
●
simple content
●
below 500 msec backend
●
tons of extras on page
●
result: 23 sec front-end time
●
+/- 50 * backend time
Front-endCONTEXT
6/59 | heisencache-15D17 | © OSInet
Frederic MARAND
www.webpagetest.org
Major Drupal Commerce site
example:
●
complex backend logic
●
optimized front-end
●
+/- 4 * backend time
●
backend impact = 25%
Back-endCONTEXT
7/59 | heisencache-15D17 | © OSInet
Frederic MARAND
●
Level 1: page caching
●
Opcode cache
●
Varnish, CDN
●
Level 2: storage tuning
●
MySQL slow queries
●
MongoDB, Redis, ...
●
Level 3: cache tuning
●
On we go...
CC BY­NC­ND 2.0 najbo/Flickr
Battle planCONTEXT
8/59 | heisencache-15D17 | © OSInet
Frederic MARAND
CONTEXT
LESS DB QUERIES MEANS
DATA CACHING
Drupal needs caching
Cache is a good thing
«Cache is king»
Steve Souders, author of High-Performance web sites
http://fr.slideshare.net/souders/cache-is-king
9/59 | heisencache-15D17 | © OSInet
Frederic MARAND
Photo by Alan Light
Too much of a
good thing is
WONDERFUL
10/59 | heisencache-15D17 | © OSInet
Frederic MARAND
(Not that kind of good thing)
CONTEXT
11/59 | heisencache-15D17 | © OSInet
Frederic MARAND
CONTEXT
CACHING CAN BE BAD
●
Memcached speed +/- like good MySQL
●
Can be worse: clustering network issues
●
A miss costs more than uncached work
12/59 | heisencache-15D17 | © OSInet
Frederic MARAND
CONTEXT
HOW DO YOU
KNOW WHEN
YOU'VE HAD
ENOUGH?
MEASURE!
CC BY­NC­ND 3.0 http://saintgasoline.com
14/59 | heisencache-15D17 | © OSInet
Frederic MARAND
Introducing HEISENCACHE
8.x
com
ing
15/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS
IMPLEMENTATION
MEASURING
CONTEXT
16/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING
WHY HEISENCACHE?
CC BY 3.0 Gerhard Hund
17/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING
●
Reduce uncertainty
●
Minimize observer impact
●
Don't push the analogy too far
18/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING
THE COST OF MEASUREMENT
●
Observer code runs within Drupal
●
Needs to be invoked → more CPU
●
Needs to store data → more I/O
19/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING
CACHING BEHAVIOUR
vs.
LOAD PROFILE
20/59 | heisencache-15D17 | © OSInet
Frederic MARAND
● Instant peaks for top content
● Fast decay
● TTL works wonders
● Long tail issues
MEASURING: Sports site
CC BY 2.0 Ronnie Macdonald
21/59 | heisencache-15D17 | © OSInet
Frederic MARAND
● Many content pieces
● Few repeat hits
● Complex cache policy
● Avoid caching some data
● Preserve cache memory
for selected content
MEASURING: Regional TV
22/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING
OBSERVE CACHE IN
PRODUCTION
23/59 | heisencache-15D17 | © OSInet
Frederic MARAND
MEASURING in production
●
Precision vs. velocity?
●
Performance module
●
Cannot write to the DB in real-time
●
Cached pages
●
Observing Drupal bootstrap
24/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS
IMPLEMENTATION
MEASURING
CONTEXT
25/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: early hits
DRUPAL 7 BOOT SEQUENCE
● Page cycle: index.php drupal_bootstrap→
– Phases: Configuration, Page Cache, DB, Variables,
Session, Page Header, Language, Full
– Cache handlers declaration: settings.php
– Exotic early hits : sites.php, settings.php,
drupal_settings_initialize()
– Common early hits : _drupal_bootstrap_page_cache
●
Need to work before DB and module system
29/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: early hits
SOLUTION
D7 : Use a standalone event system
D8 : Use the SF2 EventDispatcher
30/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: operation
IDEAS ●
Doctrine, NodeJS and Symfony
event systems
●
Use dependency injection, but
no DIC (on D7)
●
Use the standard DIC and
event system (on D8)
31/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: operation
BONUS ●
D7 : Composer for deployment
– Before hooks, so no
composer_manager
●
D8 : normal service, easy to
build
●
Easy unit testing → decent
code coverage
32/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: coverage
33/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION
cache (factory, backend) driver
DECORATOR PATTERN
●
Original Inspiration: authcache
●
Read existing cache configuration
●
D7 : wrap settings, claim to be the sole cache provider
●
D8 : decorate CacheFactory, CacheBackends
●
Handle requests per the original configuration, but
enhance the service
34/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION:
events
EMIT EVENTS AROUND ALL OPERATIONS
●
Configuration
●
Initialization
●
Cache operations
●
…and page termination
35/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: late hits
CATCHING LATE HITS 1/2
●
D7 hook_exit ? Lots of code after that
@see drupal_page_footer()
●
D7 Catching page caching ?
– not triggered on AJAX callbacks
@see ajax_deliver()
– poormancron can run lots of code after
that
36/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: late hits
CATCHING LATE HITS 2/2
●
D7/D8 Catching the session commit?
– Only if a session was started
– Dirty interactions
– Session regeneration
●
D8 : kernel.terminate, kernel.response ?
●
=> Shutdown function stack
37/59 | heisencache-15D17 | © OSInet
Frederic MARAND
NEEDS ●
minimize I/O load
→ aim for #writes <= 1
●
«Fingers crossed»-inspired strategy
– Keep data in memory during the
page lifecycle
– Write it at end of page
IMPLEMENTATION:
storing data
38/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION:
storing data
CHALLENGES ●
Writing after the last possible
cache operation
●
Write while classes are still
available
●
D7 : Passing information
within an event-oriented
procedural code base
39/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: D7 events
EventEmitter (à la Node)
●
narrowcast events created by sources
●
subscribers add/remove events on the
fly
– can further tighten narrowcasting
40/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: D7 events
EventSubscriberInterface
●
Doctrine/Symfony
●
+ (add | remove)Event()
EventSourceInterface
●
Define events a source can emit
●
Base source of events: Cache API
41/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: events
D7/D8 SYNTHETIC EVENTS
●
API Limitations: post-operation cache
events do not get the operation settings
●
Enable immediate event reconciliation
●
Event susbcribers can also be sources
42/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: events
D7/D8 SYNTHETIC EVENT EXAMPLES
●
MissSubscriber: miss info for Cache::get()
●
PerformanceSubscriber: timing info for all
ops
●
WriteSubscriber: single event for write and
delete ops
44/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: setup
settings.heisencache.inc
D7 CONFIGURATION
●
Retrieve the EventEmitter from Config instance
●
Create EventSubscriber instances as chosen
●
Register them on chosen events
●
DebugSubscriber listen to all events
– not in production !
●
Don't forget to include a WriterSubscriber
●
D8 : customize development.services.yml
45/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: extending
HEISENCACHE IS A CODER TOOL
46/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: extending
EASY TO EXTEND :
●
Write additional EventSubscriber classes
●
Add them to your configuration
ALREADY EXTENDED :
●
WriterSubscriber (France Télévisions)
●
CacheReadLogWriterSubscriber (AmazeeLabs)
●
Alternate loader (AmazeeLabs)
47/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: extending
MOST TYPICAL
●
Create new subscriber for custom conditions
●
Create new writer classes
●
Target alternate stores for speed and ease
●
MongoDB
●
K/V or data structure store (Redis)
●
Message queue (Beanstalkd, RabbitMQ,
ZeroMQ, etc)
50/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: UI
●
ROLL YOUR OWN!
● Use WatchdogSubscriber data
●
Use admin/reports/dblog or rework it
●
Views integration
● Use the SqlWriterSubscriber data
●
Two default views provided (Sql, Watchdog)
●
Symfony WebProfiler toolbar
●
Replace/complement existing cache report
51/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: UI
●
Data collecting: raw data, big volume
●
Three-step data processing
‒
Collect → Heisencache
‒
Cook → Process data based on your needs
‒
Consumer → Visualize processed data
●
Sweet spot
‒
Use a queue (Beanstalkd, etc) instead of cron
‒
Time-series database for longitudinal analysis :
RRD, InfluxDB, OpenTSDB ...
52/59 | heisencache-15D17 | © OSInet
Frederic MARAND
IMPLEMENTATION: UI
Comparing with network analysis
●
Heisencache is like
‒
libpcap / tcpdump / iptrace / snoop ...
●
Someone has to design a Wireshark on top of it
53/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS
IMPLEMENTATION
MEASURING
CONTEXT
54/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS: instant data
TYPICAL USEFUL INSTANT RESULTS
●
Repeated misses
– Usual suspects: default Memcached and big writes
(prod)
– Rewriting a variable on most pages (dev)
●
Many calls to same key
– Usual suspect: missing or broken static cache
●
Many calls to related keys
– Usual suspect: code loop instead of cache multiple
55/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS: longitudinal analysis
TYPICAL USEFUL TIME-SERIES RESULTS
●
Size of known-to-be-growing keys. Usual suspects:
– Translation cache → Someone left a t($foo) somewhere
– Context cache → Contexts are piled instead of refactored
– Views plugins → Hard Views problem. Partial fix only.
●
Miss rate shooting up from baseline on a bin
– Call for instant analysis on that bin: likely a code regression
●
Response time shooting up on a normally stable key
– Network/server problem, bin saturation
– Call for instant analysis on the cache instance
56/59 | heisencache-15D17 | © OSInet
Frederic MARAND
RESULTS : beyond debugging
●
Storing cache hit patterns for cache
warming
●
Pre-warm cache on keys selected with a
Heisencache WriterSubscriber
●
Exemple with the AmazeeLabs fork :
https://github.com/AmazeeLabs/heisencache
58/59 | heisencache-15D17 | © OSInet
Frederic MARAND
Drupal 8?
WHEN?
●
When bigger sites start to deploy D8
●
…and need them to go faster :-)
●
First steps already available :
●
https://github.com/FGM/heisencache
59/59 | heisencache-15D17 | © OSInet
Frederic MARAND
Drupal, faster
http://www.osinet.fr/

More Related Content

Similar to Cache speedup with Heisencache for Drupal 7 and Drupal 8

What's New in OpenLDAP
What's New in OpenLDAPWhat's New in OpenLDAP
What's New in OpenLDAPLDAPCon
 
[scala.by] Launching new application fast
[scala.by] Launching new application fast[scala.by] Launching new application fast
[scala.by] Launching new application fast
Denis Karpenko
 
200860 installing an enterprise environment
200860 installing an enterprise environment200860 installing an enterprise environment
200860 installing an enterprise environment
p6academy
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
Mathew Beane
 
OpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCmsOpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCms
Alkacon Software GmbH & Co. KG
 
SUTOL 2015 - A Performance Boost for your IBM Notes Client
SUTOL 2015 - A Performance Boost for your IBM Notes ClientSUTOL 2015 - A Performance Boost for your IBM Notes Client
SUTOL 2015 - A Performance Boost for your IBM Notes Client
Christoph Adler
 
Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021
Martin Anderson-Clutz
 
Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017
Sander Mangel
 
Automation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure DataAutomation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure Data
Yan Wang
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
Denis Gundarev
 
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
Dakiry
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimization
Radek Baczynski
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
OW2
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDoku
 
DNSTap Webinar
DNSTap WebinarDNSTap Webinar
DNSTap Webinar
Men and Mice
 
NetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and VerticaNetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and Vertica
Josef Niedermeier
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
NETWAYS
 
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-ReloadedRNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
panagenda
 
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-ReloadedRNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
Christoph Adler
 
R12.2 dba
R12.2 dbaR12.2 dba
R12.2 dba
ansalapi
 

Similar to Cache speedup with Heisencache for Drupal 7 and Drupal 8 (20)

What's New in OpenLDAP
What's New in OpenLDAPWhat's New in OpenLDAP
What's New in OpenLDAP
 
[scala.by] Launching new application fast
[scala.by] Launching new application fast[scala.by] Launching new application fast
[scala.by] Launching new application fast
 
200860 installing an enterprise environment
200860 installing an enterprise environment200860 installing an enterprise environment
200860 installing an enterprise environment
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
 
OpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCmsOpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCms
 
SUTOL 2015 - A Performance Boost for your IBM Notes Client
SUTOL 2015 - A Performance Boost for your IBM Notes ClientSUTOL 2015 - A Performance Boost for your IBM Notes Client
SUTOL 2015 - A Performance Boost for your IBM Notes Client
 
Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021
 
Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017Headless Magento - Meet Magento Poland 2017
Headless Magento - Meet Magento Poland 2017
 
Automation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure DataAutomation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure Data
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
 
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
ROMA NOVIKOV, BAQ, "Prometheus + grafana based monitoring"
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimization
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
 
DNSTap Webinar
DNSTap WebinarDNSTap Webinar
DNSTap Webinar
 
NetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and VerticaNetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and Vertica
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
 
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-ReloadedRNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
RNUG 2020: HCL Notes 11.0.1 FP2 - Performance Boost Re-Reloaded
 
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-ReloadedRNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
 
R12.2 dba
R12.2 dbaR12.2 dba
R12.2 dba
 

More from OSInet

Interface texte plein écran en Go avec TView
Interface texte plein écran en Go avec TViewInterface texte plein écran en Go avec TView
Interface texte plein écran en Go avec TView
OSInet
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
OSInet
 
Mon site web est hacké ! Que faire ?
Mon site web est hacké ! Que faire ?Mon site web est hacké ! Que faire ?
Mon site web est hacké ! Que faire ?
OSInet
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue API
OSInet
 
Life after the hack
Life after the hackLife after the hack
Life after the hack
OSInet
 
Delayed operations with queues for website performance
Delayed operations with queues for website performanceDelayed operations with queues for website performance
Delayed operations with queues for website performance
OSInet
 
Drupal 8 : regards croisés
Drupal 8 : regards croisésDrupal 8 : regards croisés
Drupal 8 : regards croisés
OSInet
 
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
OSInet
 
Le groupe PHP-FIG et les standards PSR
Le groupe  PHP-FIG et les standards PSRLe groupe  PHP-FIG et les standards PSR
Le groupe PHP-FIG et les standards PSR
OSInet
 
Les blocs Drupal de drop.org à Drupal 8
Les blocs Drupal de drop.org à Drupal 8Les blocs Drupal de drop.org à Drupal 8
Les blocs Drupal de drop.org à Drupal 8
OSInet
 
Utiliser drupal
Utiliser drupalUtiliser drupal
Utiliser drupal
OSInet
 
Equipe drupal
Equipe drupalEquipe drupal
Equipe drupalOSInet
 
Pourquoi choisir un CMS Open Source ?
Pourquoi choisir un CMS Open Source ?Pourquoi choisir un CMS Open Source ?
Pourquoi choisir un CMS Open Source ?OSInet
 
Drupal et le NoSQL - drupagora 2011
Drupal et le NoSQL - drupagora 2011Drupal et le NoSQL - drupagora 2011
Drupal et le NoSQL - drupagora 2011
OSInet
 
Drupal Views development
Drupal Views developmentDrupal Views development
Drupal Views development
OSInet
 

More from OSInet (15)

Interface texte plein écran en Go avec TView
Interface texte plein écran en Go avec TViewInterface texte plein écran en Go avec TView
Interface texte plein écran en Go avec TView
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
Mon site web est hacké ! Que faire ?
Mon site web est hacké ! Que faire ?Mon site web est hacké ! Que faire ?
Mon site web est hacké ! Que faire ?
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue API
 
Life after the hack
Life after the hackLife after the hack
Life after the hack
 
Delayed operations with queues for website performance
Delayed operations with queues for website performanceDelayed operations with queues for website performance
Delayed operations with queues for website performance
 
Drupal 8 : regards croisés
Drupal 8 : regards croisésDrupal 8 : regards croisés
Drupal 8 : regards croisés
 
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
Recueil des mauvaises pratiques constatées lors de l'audit de sites Drupal 7
 
Le groupe PHP-FIG et les standards PSR
Le groupe  PHP-FIG et les standards PSRLe groupe  PHP-FIG et les standards PSR
Le groupe PHP-FIG et les standards PSR
 
Les blocs Drupal de drop.org à Drupal 8
Les blocs Drupal de drop.org à Drupal 8Les blocs Drupal de drop.org à Drupal 8
Les blocs Drupal de drop.org à Drupal 8
 
Utiliser drupal
Utiliser drupalUtiliser drupal
Utiliser drupal
 
Equipe drupal
Equipe drupalEquipe drupal
Equipe drupal
 
Pourquoi choisir un CMS Open Source ?
Pourquoi choisir un CMS Open Source ?Pourquoi choisir un CMS Open Source ?
Pourquoi choisir un CMS Open Source ?
 
Drupal et le NoSQL - drupagora 2011
Drupal et le NoSQL - drupagora 2011Drupal et le NoSQL - drupagora 2011
Drupal et le NoSQL - drupagora 2011
 
Drupal Views development
Drupal Views developmentDrupal Views development
Drupal Views development
 

Recently uploaded

Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 

Recently uploaded (20)

Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 

Cache speedup with Heisencache for Drupal 7 and Drupal 8

  • 1. Speed up your data caches with Heisencache Frédéric G. Marand
  • 2. 3/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS IMPLEMENTATION MEASURING CONTEXT
  • 3. 4/59 | heisencache-15D17 | © OSInet Frederic MARAND Perception ● Front-end dominates ● Downloads start after the page is served ● Not all sites are equal when it comes to the back/front performance ratio CONTEXT
  • 4. 5/59 | heisencache-15D17 | © OSInet Frederic MARANDwww.webpagetest.org Major press site example: ● simple content ● below 500 msec backend ● tons of extras on page ● result: 23 sec front-end time ● +/- 50 * backend time Front-endCONTEXT
  • 5. 6/59 | heisencache-15D17 | © OSInet Frederic MARAND www.webpagetest.org Major Drupal Commerce site example: ● complex backend logic ● optimized front-end ● +/- 4 * backend time ● backend impact = 25% Back-endCONTEXT
  • 6. 7/59 | heisencache-15D17 | © OSInet Frederic MARAND ● Level 1: page caching ● Opcode cache ● Varnish, CDN ● Level 2: storage tuning ● MySQL slow queries ● MongoDB, Redis, ... ● Level 3: cache tuning ● On we go... CC BY­NC­ND 2.0 najbo/Flickr Battle planCONTEXT
  • 7. 8/59 | heisencache-15D17 | © OSInet Frederic MARAND CONTEXT LESS DB QUERIES MEANS DATA CACHING Drupal needs caching Cache is a good thing «Cache is king» Steve Souders, author of High-Performance web sites http://fr.slideshare.net/souders/cache-is-king
  • 8. 9/59 | heisencache-15D17 | © OSInet Frederic MARAND Photo by Alan Light Too much of a good thing is WONDERFUL
  • 9. 10/59 | heisencache-15D17 | © OSInet Frederic MARAND (Not that kind of good thing) CONTEXT
  • 10. 11/59 | heisencache-15D17 | © OSInet Frederic MARAND CONTEXT CACHING CAN BE BAD ● Memcached speed +/- like good MySQL ● Can be worse: clustering network issues ● A miss costs more than uncached work
  • 11. 12/59 | heisencache-15D17 | © OSInet Frederic MARAND CONTEXT HOW DO YOU KNOW WHEN YOU'VE HAD ENOUGH? MEASURE! CC BY­NC­ND 3.0 http://saintgasoline.com
  • 12. 14/59 | heisencache-15D17 | © OSInet Frederic MARAND Introducing HEISENCACHE 8.x com ing
  • 13. 15/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS IMPLEMENTATION MEASURING CONTEXT
  • 14. 16/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING WHY HEISENCACHE? CC BY 3.0 Gerhard Hund
  • 15. 17/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING ● Reduce uncertainty ● Minimize observer impact ● Don't push the analogy too far
  • 16. 18/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING THE COST OF MEASUREMENT ● Observer code runs within Drupal ● Needs to be invoked → more CPU ● Needs to store data → more I/O
  • 17. 19/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING CACHING BEHAVIOUR vs. LOAD PROFILE
  • 18. 20/59 | heisencache-15D17 | © OSInet Frederic MARAND ● Instant peaks for top content ● Fast decay ● TTL works wonders ● Long tail issues MEASURING: Sports site CC BY 2.0 Ronnie Macdonald
  • 19. 21/59 | heisencache-15D17 | © OSInet Frederic MARAND ● Many content pieces ● Few repeat hits ● Complex cache policy ● Avoid caching some data ● Preserve cache memory for selected content MEASURING: Regional TV
  • 20. 22/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING OBSERVE CACHE IN PRODUCTION
  • 21. 23/59 | heisencache-15D17 | © OSInet Frederic MARAND MEASURING in production ● Precision vs. velocity? ● Performance module ● Cannot write to the DB in real-time ● Cached pages ● Observing Drupal bootstrap
  • 22. 24/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS IMPLEMENTATION MEASURING CONTEXT
  • 23. 25/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: early hits DRUPAL 7 BOOT SEQUENCE ● Page cycle: index.php drupal_bootstrap→ – Phases: Configuration, Page Cache, DB, Variables, Session, Page Header, Language, Full – Cache handlers declaration: settings.php – Exotic early hits : sites.php, settings.php, drupal_settings_initialize() – Common early hits : _drupal_bootstrap_page_cache ● Need to work before DB and module system
  • 24. 29/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: early hits SOLUTION D7 : Use a standalone event system D8 : Use the SF2 EventDispatcher
  • 25. 30/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: operation IDEAS ● Doctrine, NodeJS and Symfony event systems ● Use dependency injection, but no DIC (on D7) ● Use the standard DIC and event system (on D8)
  • 26. 31/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: operation BONUS ● D7 : Composer for deployment – Before hooks, so no composer_manager ● D8 : normal service, easy to build ● Easy unit testing → decent code coverage
  • 27. 32/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: coverage
  • 28. 33/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION cache (factory, backend) driver DECORATOR PATTERN ● Original Inspiration: authcache ● Read existing cache configuration ● D7 : wrap settings, claim to be the sole cache provider ● D8 : decorate CacheFactory, CacheBackends ● Handle requests per the original configuration, but enhance the service
  • 29. 34/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: events EMIT EVENTS AROUND ALL OPERATIONS ● Configuration ● Initialization ● Cache operations ● …and page termination
  • 30. 35/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: late hits CATCHING LATE HITS 1/2 ● D7 hook_exit ? Lots of code after that @see drupal_page_footer() ● D7 Catching page caching ? – not triggered on AJAX callbacks @see ajax_deliver() – poormancron can run lots of code after that
  • 31. 36/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: late hits CATCHING LATE HITS 2/2 ● D7/D8 Catching the session commit? – Only if a session was started – Dirty interactions – Session regeneration ● D8 : kernel.terminate, kernel.response ? ● => Shutdown function stack
  • 32. 37/59 | heisencache-15D17 | © OSInet Frederic MARAND NEEDS ● minimize I/O load → aim for #writes <= 1 ● «Fingers crossed»-inspired strategy – Keep data in memory during the page lifecycle – Write it at end of page IMPLEMENTATION: storing data
  • 33. 38/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: storing data CHALLENGES ● Writing after the last possible cache operation ● Write while classes are still available ● D7 : Passing information within an event-oriented procedural code base
  • 34. 39/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: D7 events EventEmitter (à la Node) ● narrowcast events created by sources ● subscribers add/remove events on the fly – can further tighten narrowcasting
  • 35. 40/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: D7 events EventSubscriberInterface ● Doctrine/Symfony ● + (add | remove)Event() EventSourceInterface ● Define events a source can emit ● Base source of events: Cache API
  • 36. 41/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: events D7/D8 SYNTHETIC EVENTS ● API Limitations: post-operation cache events do not get the operation settings ● Enable immediate event reconciliation ● Event susbcribers can also be sources
  • 37. 42/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: events D7/D8 SYNTHETIC EVENT EXAMPLES ● MissSubscriber: miss info for Cache::get() ● PerformanceSubscriber: timing info for all ops ● WriteSubscriber: single event for write and delete ops
  • 38. 44/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: setup settings.heisencache.inc D7 CONFIGURATION ● Retrieve the EventEmitter from Config instance ● Create EventSubscriber instances as chosen ● Register them on chosen events ● DebugSubscriber listen to all events – not in production ! ● Don't forget to include a WriterSubscriber ● D8 : customize development.services.yml
  • 39. 45/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: extending HEISENCACHE IS A CODER TOOL
  • 40. 46/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: extending EASY TO EXTEND : ● Write additional EventSubscriber classes ● Add them to your configuration ALREADY EXTENDED : ● WriterSubscriber (France Télévisions) ● CacheReadLogWriterSubscriber (AmazeeLabs) ● Alternate loader (AmazeeLabs)
  • 41. 47/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: extending MOST TYPICAL ● Create new subscriber for custom conditions ● Create new writer classes ● Target alternate stores for speed and ease ● MongoDB ● K/V or data structure store (Redis) ● Message queue (Beanstalkd, RabbitMQ, ZeroMQ, etc)
  • 42. 50/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: UI ● ROLL YOUR OWN! ● Use WatchdogSubscriber data ● Use admin/reports/dblog or rework it ● Views integration ● Use the SqlWriterSubscriber data ● Two default views provided (Sql, Watchdog) ● Symfony WebProfiler toolbar ● Replace/complement existing cache report
  • 43. 51/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: UI ● Data collecting: raw data, big volume ● Three-step data processing ‒ Collect → Heisencache ‒ Cook → Process data based on your needs ‒ Consumer → Visualize processed data ● Sweet spot ‒ Use a queue (Beanstalkd, etc) instead of cron ‒ Time-series database for longitudinal analysis : RRD, InfluxDB, OpenTSDB ...
  • 44. 52/59 | heisencache-15D17 | © OSInet Frederic MARAND IMPLEMENTATION: UI Comparing with network analysis ● Heisencache is like ‒ libpcap / tcpdump / iptrace / snoop ... ● Someone has to design a Wireshark on top of it
  • 45. 53/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS IMPLEMENTATION MEASURING CONTEXT
  • 46. 54/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS: instant data TYPICAL USEFUL INSTANT RESULTS ● Repeated misses – Usual suspects: default Memcached and big writes (prod) – Rewriting a variable on most pages (dev) ● Many calls to same key – Usual suspect: missing or broken static cache ● Many calls to related keys – Usual suspect: code loop instead of cache multiple
  • 47. 55/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS: longitudinal analysis TYPICAL USEFUL TIME-SERIES RESULTS ● Size of known-to-be-growing keys. Usual suspects: – Translation cache → Someone left a t($foo) somewhere – Context cache → Contexts are piled instead of refactored – Views plugins → Hard Views problem. Partial fix only. ● Miss rate shooting up from baseline on a bin – Call for instant analysis on that bin: likely a code regression ● Response time shooting up on a normally stable key – Network/server problem, bin saturation – Call for instant analysis on the cache instance
  • 48. 56/59 | heisencache-15D17 | © OSInet Frederic MARAND RESULTS : beyond debugging ● Storing cache hit patterns for cache warming ● Pre-warm cache on keys selected with a Heisencache WriterSubscriber ● Exemple with the AmazeeLabs fork : https://github.com/AmazeeLabs/heisencache
  • 49. 58/59 | heisencache-15D17 | © OSInet Frederic MARAND Drupal 8? WHEN? ● When bigger sites start to deploy D8 ● …and need them to go faster :-) ● First steps already available : ● https://github.com/FGM/heisencache
  • 50. 59/59 | heisencache-15D17 | © OSInet Frederic MARAND Drupal, faster http://www.osinet.fr/