SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Intelligent, Tiered, Scalable
Caching with LCache
1
Existing Cachinng Challenges
2
Pantheon.io
Traditional Web Caching
3
Redis or
Memcache
Cache Traffic
Web
Server
Web
Server
Web
Server
Web
Server
Bottleneck
Pantheon.io
The Anatomy of a Bottleneck
4
Pantheon.io
Scaling Traditional Web Caching
5
Redis or
Memcache
Cache Traffic
Web
Server
Web
Server
Web
Server
Web
Server
Redis or
Memcache
● Use replication?
○ Failover issues
○ Replication lag
or slow writes
● Use sharding?
○ Consistency issues
● Still network-bound
Proudly Designed Elsewhere:
Employing Known Solutions
6
Pantheon.io
Existing Solutions: Multi-Core Processors
7
Pantheon.io
W
rites
Existing Solutions: Pantheon’s Valhalla
8
Application
Container
File
Mount
Cache
Application
Container
File
Mount
Cache Application
Container
File
Mount
Cache
File
Server
File
Server
File
Server
Events
Pantheon.io
Row Changes
(No SQL)
SQL
Existing Solutions: MySQL Row Replication
9
MySQL
Primary
Application
MySQL Replica
shell> mysqlbinlog -vv log_file
...
# at 302
#080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags:
STMT_END_F
BINLOG '
fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP
'/*!*/;
### UPDATE test.t
### WHERE
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2='apple' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
### @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2='pear' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
### @3='2009:01:01' /* DATE meta=0 nullable=1 is_null=0 */
Keeps
Replication
Simple!
Pantheon.io
“Because it’s faster, of course.”
● Inspired by multicore processors
⌾ Get the working set close to the work
⌾ Trade some write performance and scale for massive read gains
⌾ Hide the coherency management
● Inspired by Pantheon’s Valhalla file system
⌾ Write-through: clients can leave at any point
⌾ Incremental changes freshen the local cache
⌾ Only as read-after-write consistent as it needs to be
● Inspired by MySQL row-based replication
⌾ Materialize complex tag deletion on the primary instance
and only replicate the key-based changes
10
Pantheon.io
Contrast: ChainedFastBackend
11
LCache ChainedFastBackend
Beginning of
Request
Synchronizes cache writes and bin/key invalidations.
One SELECT query.
Updates bin invalidation data.
One SELECT query.
Read Key Reads local cache. If no key does not exist in the local
cache, reads consistent cache.
No query if hitting local cache.
Reads from local cache.
No query if hitting local cache.
Write or
Invalidate Key
Writes to local and consistent caches.
One INSERT query.
Writes to local and consistent caches.
Invalidates entire bin in all local caches.
Up to two queries per write.
Invalidate Tag Writes to consistent cache and generates key
invalidations. Multiple queries.
Writes to consistent cache.
Invalidates entire bin in local caches.
End of Request Garbage-collects deletions.
Executes one batched DELETE query
(if cache writes have occurred) after request
closes.
No activity.
Challenges and Solutions
12
Pantheon.io
Unexpected Issues
● Sites write to caches very often
⌾ Seeing 10-40 cache “sets” per page
⌾ LCache’s “sets” are expensive (transactional database plus replication to clients)
⌾ Most modules assume a miss is a good reason to “set.”
⌾ Some cache items are “set” more than “get.”
● Using tags for bins was not fast enough
⌾ Relational model created too much overhead
⌾ Materializing the clearing of a whole bin wasn’t efficient (replicated many, many changes)
⌾ Moved to native bin support
13
Pantheon.io
Write Models to Optimize the “Set” Path
14
Low Splay
(each write to random choice of 64 keys)
High Splay
(each write to random choice of 4096 keys)
10 Processes ✕ 40 Writes Each
Winner here!
And not
worse here!
Pantheon.io
Machine Learning: Avoiding Useless “Sets”
15
Loading iterator...
Iterating...
Array
(
[lcache:10.223.176.176:18341:5:cache:environment_indicator] => 5634
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:taxonomy_term] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_8] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_1] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_2] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_3] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:calendar] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_5] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:redirects] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:backlinks] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_7] => 3037
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_6] => 3036
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:frontpage] => 3036
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_4] => 3036
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:agency_search] => 3036
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:glossary] => 3036
[lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:campaign] => 3036
LCache starts
ignoring at 100 now
Pantheon.io
Configuration: Assigning Bins and Keys
● Better with LCache
⌾ Frequently read
⌾ Rarely written
⌾ Large
● Worse (or not ideal) with LCache
⌾ Read once or not at all (e.g. form cache should use normal database cache backend)
⌾ Things handleable earlier in the stack (e.g. Varnish instead of Drupal’s page cache)
⌾ Keys updated often (partly mitigated with machine learning)
⌾ Clearing 100+ keys with a tag (because of replication)
16
Built for Reliability
17
Pantheon.io
Test-Driven Development
18
Pantheon.io
Composer-Based Library
19
Pantheon.io
Lightweight Adapters for Frameworks
● Stateless
● Composer inclusion of the LCache library
● Modules and extensions
⌾ Drupal 7 module
⌾ Drupal 8 module
⌾ WordPress drop-in
● Drupal 8.3+ core?
20
Performance and Scalability
21
Pantheon.io
Comparing Against Redis: Performance
22
Pantheon.io
Comparing Against Redis: Concurrency
23
Pantheon.io
Going Live: Performance
24
Pantheon.io
Going Live: Impact on Databases
25
Next Steps
26
Pantheon.io
Further Performance Improvements
● Try mysqli with asynchronous queries for the initial synchronization.
⌾ Upside: No synchronous wait on obtaining events.
⌾ Downside: Yet another database connection.
● Synchronize (again) in the destructor after the request closes.
⌾ Upside: Potentially handles some events without users waiting.
⌾ Downside: Additional database queries.
● SQLite L1 cache
⌾ Upside: Persists across PHP-FPM restarts. Useful with CLI.
Cache can be larger than memory.
⌾ Downside: Slower writes. Possible lock contention.
27
Pantheon.io
Ambitions for Core
● ChainedFastBackend isn’t going to cut it.
⌾ Not usable for most cache bins.
⌾ Administrators need to carefully choose when to introduce it.
⌾ Degrades rapidly on cache writes.
● Even just the LCache L2 component is faster than Drupal’s built-in caches.
⌾ INSERT-only model is a big win.
⌾ LCache can use a Null L1 seamlessly.
● Relying on Composer-based libraries is widespread in Drupal 8.
● A default cache for most bins
28
Pantheon.io
PSR-6 and PSR-16
● PSR-6
⌾ No concept of cache tags, an essential part of Drupal 8 caching.
⌾ No concept of retrieving invalidated items.
(Not supported in LCache yet, but supported by Drupal 8.)
⌾ Interesting concept of deferred persistence.
● PSR-16
⌾ Counter interface wouldn’t be consumed by Drupal 8 (but would be by WordPress).
⌾ Mostly built on PSR-6.
29
@DavidStrauss
david@pantheon.io
30
Questions?

Mais conteúdo relacionado

Mais procurados

MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
Abdul Manaf
 

Mais procurados (20)

Top 15 MySQL parameters
Top 15 MySQL parameters Top 15 MySQL parameters
Top 15 MySQL parameters
 
HTTP Plugin for MySQL!
HTTP Plugin for MySQL!HTTP Plugin for MySQL!
HTTP Plugin for MySQL!
 
Proxysql use case scenarios fosdem17
Proxysql use case scenarios    fosdem17Proxysql use case scenarios    fosdem17
Proxysql use case scenarios fosdem17
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
 
Memcached
MemcachedMemcached
Memcached
 
Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
 
Databases in the hosted cloud
Databases in the hosted cloudDatabases in the hosted cloud
Databases in the hosted cloud
 
Designing enterprise drupal
Designing enterprise drupalDesigning enterprise drupal
Designing enterprise drupal
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
Perconalive feb-2011-share
Perconalive feb-2011-sharePerconalive feb-2011-share
Perconalive feb-2011-share
 
Highly Available MySQL/PHP Applications with mysqlnd
Highly Available MySQL/PHP Applications with mysqlndHighly Available MySQL/PHP Applications with mysqlnd
Highly Available MySQL/PHP Applications with mysqlnd
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
 
Built-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIsBuilt-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIs
 
Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonMariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
 
Streaming millions of Contact Center interactions in (near) real-time with Pu...
Streaming millions of Contact Center interactions in (near) real-time with Pu...Streaming millions of Contact Center interactions in (near) real-time with Pu...
Streaming millions of Contact Center interactions in (near) real-time with Pu...
 
MongoDB Engines: Demystified
MongoDB Engines: DemystifiedMongoDB Engines: Demystified
MongoDB Engines: Demystified
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 

Destaque

Tamaulipas, una entidad con vocación energética
Tamaulipas, una entidad con vocación energética Tamaulipas, una entidad con vocación energética
Tamaulipas, una entidad con vocación energética
Nestor Garcia
 
VALUES-Brooke_Denton
VALUES-Brooke_DentonVALUES-Brooke_Denton
VALUES-Brooke_Denton
Brooke Denton
 
07 construyendo una vida de agradecimiento a dios
07 construyendo una vida de agradecimiento a dios07 construyendo una vida de agradecimiento a dios
07 construyendo una vida de agradecimiento a dios
hassjire
 

Destaque (20)

Circuitos eléctricos en serie
Circuitos eléctricos en serieCircuitos eléctricos en serie
Circuitos eléctricos en serie
 
Effective service and resource management with systemd
Effective service and resource management with systemdEffective service and resource management with systemd
Effective service and resource management with systemd
 
Write, Publish and Market Your Kindle Book in 4 Weeks
Write, Publish and Market Your Kindle Book in 4 WeeksWrite, Publish and Market Your Kindle Book in 4 Weeks
Write, Publish and Market Your Kindle Book in 4 Weeks
 
Gastrointestinales
GastrointestinalesGastrointestinales
Gastrointestinales
 
Tamaulipas, una entidad con vocación energética
Tamaulipas, una entidad con vocación energética Tamaulipas, una entidad con vocación energética
Tamaulipas, una entidad con vocación energética
 
Fibrilaciones cardiacas
Fibrilaciones cardiacasFibrilaciones cardiacas
Fibrilaciones cardiacas
 
Clase 5
Clase 5Clase 5
Clase 5
 
VALUES-Brooke_Denton
VALUES-Brooke_DentonVALUES-Brooke_Denton
VALUES-Brooke_Denton
 
Leda digitalt utvecklingsarbete, varför, vad & hur
Leda digitalt utvecklingsarbete, varför, vad & hurLeda digitalt utvecklingsarbete, varför, vad & hur
Leda digitalt utvecklingsarbete, varför, vad & hur
 
Your Resilience Your Response
Your Resilience Your ResponseYour Resilience Your Response
Your Resilience Your Response
 
Evangelização - Presença Divina
Evangelização - Presença DivinaEvangelização - Presença Divina
Evangelização - Presença Divina
 
Module 01 - WebDriver Basics
Module 01 - WebDriver BasicsModule 01 - WebDriver Basics
Module 01 - WebDriver Basics
 
07 construyendo una vida de agradecimiento a dios
07 construyendo una vida de agradecimiento a dios07 construyendo una vida de agradecimiento a dios
07 construyendo una vida de agradecimiento a dios
 
[IUI 2017] Criteria Chains: A Novel Multi-Criteria Recommendation Approach
[IUI 2017] Criteria Chains: A Novel Multi-Criteria Recommendation Approach[IUI 2017] Criteria Chains: A Novel Multi-Criteria Recommendation Approach
[IUI 2017] Criteria Chains: A Novel Multi-Criteria Recommendation Approach
 
Geometria analitica
Geometria analiticaGeometria analitica
Geometria analitica
 
80,000lb Bristol Riggers Special Forklift For Sale Used
80,000lb Bristol Riggers Special Forklift For Sale Used80,000lb Bristol Riggers Special Forklift For Sale Used
80,000lb Bristol Riggers Special Forklift For Sale Used
 
The Marketer's Blind Spot
The Marketer's Blind SpotThe Marketer's Blind Spot
The Marketer's Blind Spot
 
Best Practice co. Presentation for ERP odoo10
Best Practice co. Presentation for ERP odoo10Best Practice co. Presentation for ERP odoo10
Best Practice co. Presentation for ERP odoo10
 
Hemorroides
HemorroidesHemorroides
Hemorroides
 
Bloque 5 la revolución rusa y la urss
Bloque 5 la revolución rusa y la urssBloque 5 la revolución rusa y la urss
Bloque 5 la revolución rusa y la urss
 

Semelhante a LCache DrupalCon Dublin 2016

My Sql Performance On Ec2
My Sql Performance On Ec2My Sql Performance On Ec2
My Sql Performance On Ec2
MySQLConference
 
Drizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's ConferenceDrizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's Conference
Brian Aker
 
Tachyon_meetup_5-28-2015-IBM
Tachyon_meetup_5-28-2015-IBMTachyon_meetup_5-28-2015-IBM
Tachyon_meetup_5-28-2015-IBM
Shaoshan Liu
 
Globo.com & Varnish
Globo.com & VarnishGlobo.com & Varnish
Globo.com & Varnish
lokama
 

Semelhante a LCache DrupalCon Dublin 2016 (20)

My Sql Performance In A Cloud
My Sql Performance In A CloudMy Sql Performance In A Cloud
My Sql Performance In A Cloud
 
My Sql Performance On Ec2
My Sql Performance On Ec2My Sql Performance On Ec2
My Sql Performance On Ec2
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
 
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Case Study with Answers.com on Scaling with Memcached and MySQL
Case Study with Answers.com on Scaling with Memcached and MySQLCase Study with Answers.com on Scaling with Memcached and MySQL
Case Study with Answers.com on Scaling with Memcached and MySQL
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
 
An introduction to column store indexes and batch mode
An introduction to column store indexes and batch modeAn introduction to column store indexes and batch mode
An introduction to column store indexes and batch mode
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
Critical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency DatabaseCritical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency Database
 
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
 
Hyperbatch (LoteRapido) - Punta Dreamin' 2017
Hyperbatch (LoteRapido) - Punta Dreamin' 2017Hyperbatch (LoteRapido) - Punta Dreamin' 2017
Hyperbatch (LoteRapido) - Punta Dreamin' 2017
 
Drizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's ConferenceDrizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's Conference
 
Redis vs NCache - A detailed feture level comparison
Redis vs NCache - A detailed feture level comparisonRedis vs NCache - A detailed feture level comparison
Redis vs NCache - A detailed feture level comparison
 
Tachyon_meetup_5-28-2015-IBM
Tachyon_meetup_5-28-2015-IBMTachyon_meetup_5-28-2015-IBM
Tachyon_meetup_5-28-2015-IBM
 
Globo.com & Varnish
Globo.com & VarnishGlobo.com & Varnish
Globo.com & Varnish
 
WiredTiger & What's New in 3.0
WiredTiger & What's New in 3.0WiredTiger & What's New in 3.0
WiredTiger & What's New in 3.0
 

Mais de David Timothy Strauss

Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
David Timothy Strauss
 

Mais de David Timothy Strauss (12)

Container Security via Monitoring and Orchestration - Container Security Summit
Container Security via Monitoring and Orchestration - Container Security SummitContainer Security via Monitoring and Orchestration - Container Security Summit
Container Security via Monitoring and Orchestration - Container Security Summit
 
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
 
PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)
 
PHP at Density and Scale
PHP at Density and ScalePHP at Density and Scale
PHP at Density and Scale
 
PHP at Density and Scale
PHP at Density and ScalePHP at Density and Scale
PHP at Density and Scale
 
Valhalla at Pantheon
Valhalla at PantheonValhalla at Pantheon
Valhalla at Pantheon
 
Cassandra-Powered Distributed DNS
Cassandra-Powered Distributed DNSCassandra-Powered Distributed DNS
Cassandra-Powered Distributed DNS
 
Scalable Drupal Infrastructure
Scalable Drupal InfrastructureScalable Drupal Infrastructure
Scalable Drupal Infrastructure
 
Planning LAMP infrastructure
Planning LAMP infrastructurePlanning LAMP infrastructure
Planning LAMP infrastructure
 
Is Drupal Secure?
Is Drupal Secure?Is Drupal Secure?
Is Drupal Secure?
 
Cassandra queuing
Cassandra queuingCassandra queuing
Cassandra queuing
 

Último

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Último (20)

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

LCache DrupalCon Dublin 2016

  • 3. Pantheon.io Traditional Web Caching 3 Redis or Memcache Cache Traffic Web Server Web Server Web Server Web Server Bottleneck
  • 4. Pantheon.io The Anatomy of a Bottleneck 4
  • 5. Pantheon.io Scaling Traditional Web Caching 5 Redis or Memcache Cache Traffic Web Server Web Server Web Server Web Server Redis or Memcache ● Use replication? ○ Failover issues ○ Replication lag or slow writes ● Use sharding? ○ Consistency issues ● Still network-bound
  • 8. Pantheon.io W rites Existing Solutions: Pantheon’s Valhalla 8 Application Container File Mount Cache Application Container File Mount Cache Application Container File Mount Cache File Server File Server File Server Events
  • 9. Pantheon.io Row Changes (No SQL) SQL Existing Solutions: MySQL Row Replication 9 MySQL Primary Application MySQL Replica shell> mysqlbinlog -vv log_file ... # at 302 #080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags: STMT_END_F BINLOG ' fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP '/*!*/; ### UPDATE test.t ### WHERE ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2='apple' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */ ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2='pear' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3='2009:01:01' /* DATE meta=0 nullable=1 is_null=0 */ Keeps Replication Simple!
  • 10. Pantheon.io “Because it’s faster, of course.” ● Inspired by multicore processors ⌾ Get the working set close to the work ⌾ Trade some write performance and scale for massive read gains ⌾ Hide the coherency management ● Inspired by Pantheon’s Valhalla file system ⌾ Write-through: clients can leave at any point ⌾ Incremental changes freshen the local cache ⌾ Only as read-after-write consistent as it needs to be ● Inspired by MySQL row-based replication ⌾ Materialize complex tag deletion on the primary instance and only replicate the key-based changes 10
  • 11. Pantheon.io Contrast: ChainedFastBackend 11 LCache ChainedFastBackend Beginning of Request Synchronizes cache writes and bin/key invalidations. One SELECT query. Updates bin invalidation data. One SELECT query. Read Key Reads local cache. If no key does not exist in the local cache, reads consistent cache. No query if hitting local cache. Reads from local cache. No query if hitting local cache. Write or Invalidate Key Writes to local and consistent caches. One INSERT query. Writes to local and consistent caches. Invalidates entire bin in all local caches. Up to two queries per write. Invalidate Tag Writes to consistent cache and generates key invalidations. Multiple queries. Writes to consistent cache. Invalidates entire bin in local caches. End of Request Garbage-collects deletions. Executes one batched DELETE query (if cache writes have occurred) after request closes. No activity.
  • 13. Pantheon.io Unexpected Issues ● Sites write to caches very often ⌾ Seeing 10-40 cache “sets” per page ⌾ LCache’s “sets” are expensive (transactional database plus replication to clients) ⌾ Most modules assume a miss is a good reason to “set.” ⌾ Some cache items are “set” more than “get.” ● Using tags for bins was not fast enough ⌾ Relational model created too much overhead ⌾ Materializing the clearing of a whole bin wasn’t efficient (replicated many, many changes) ⌾ Moved to native bin support 13
  • 14. Pantheon.io Write Models to Optimize the “Set” Path 14 Low Splay (each write to random choice of 64 keys) High Splay (each write to random choice of 4096 keys) 10 Processes ✕ 40 Writes Each Winner here! And not worse here!
  • 15. Pantheon.io Machine Learning: Avoiding Useless “Sets” 15 Loading iterator... Iterating... Array ( [lcache:10.223.176.176:18341:5:cache:environment_indicator] => 5634 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:taxonomy_term] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_8] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_1] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_2] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_3] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:calendar] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_5] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:redirects] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:backlinks] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_7] => 3037 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_6] => 3036 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:frontpage] => 3036 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:nodequeue_4] => 3036 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:agency_search] => 3036 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:glossary] => 3036 [lcache:10.223.176.176:18341:11:cache_views:ctools_export:views_view:campaign] => 3036 LCache starts ignoring at 100 now
  • 16. Pantheon.io Configuration: Assigning Bins and Keys ● Better with LCache ⌾ Frequently read ⌾ Rarely written ⌾ Large ● Worse (or not ideal) with LCache ⌾ Read once or not at all (e.g. form cache should use normal database cache backend) ⌾ Things handleable earlier in the stack (e.g. Varnish instead of Drupal’s page cache) ⌾ Keys updated often (partly mitigated with machine learning) ⌾ Clearing 100+ keys with a tag (because of replication) 16
  • 20. Pantheon.io Lightweight Adapters for Frameworks ● Stateless ● Composer inclusion of the LCache library ● Modules and extensions ⌾ Drupal 7 module ⌾ Drupal 8 module ⌾ WordPress drop-in ● Drupal 8.3+ core? 20
  • 27. Pantheon.io Further Performance Improvements ● Try mysqli with asynchronous queries for the initial synchronization. ⌾ Upside: No synchronous wait on obtaining events. ⌾ Downside: Yet another database connection. ● Synchronize (again) in the destructor after the request closes. ⌾ Upside: Potentially handles some events without users waiting. ⌾ Downside: Additional database queries. ● SQLite L1 cache ⌾ Upside: Persists across PHP-FPM restarts. Useful with CLI. Cache can be larger than memory. ⌾ Downside: Slower writes. Possible lock contention. 27
  • 28. Pantheon.io Ambitions for Core ● ChainedFastBackend isn’t going to cut it. ⌾ Not usable for most cache bins. ⌾ Administrators need to carefully choose when to introduce it. ⌾ Degrades rapidly on cache writes. ● Even just the LCache L2 component is faster than Drupal’s built-in caches. ⌾ INSERT-only model is a big win. ⌾ LCache can use a Null L1 seamlessly. ● Relying on Composer-based libraries is widespread in Drupal 8. ● A default cache for most bins 28
  • 29. Pantheon.io PSR-6 and PSR-16 ● PSR-6 ⌾ No concept of cache tags, an essential part of Drupal 8 caching. ⌾ No concept of retrieving invalidated items. (Not supported in LCache yet, but supported by Drupal 8.) ⌾ Interesting concept of deferred persistence. ● PSR-16 ⌾ Counter interface wouldn’t be consumed by Drupal 8 (but would be by WordPress). ⌾ Mostly built on PSR-6. 29