SlideShare a Scribd company logo
1 of 31
CacheOptimizer: Helping Developers Configure
Caching Frameworks for Hibernate-based
Database-Centric Web Applications
1
Mohamed Nasser, Parminder Flora
Tse-Hsun(Peter) Chen Ahmed E. HassanWeiyi Shang
– Over 1 billion page views per day
– 44 billion SQL executions per day
– 8 billion minutes online everyday
– Over 1.2 million photos a sec at peak
Modern Database-Centric Web Applications:
Millions of Users, Billions of Transactions
Gmail’s 25 to 55 minutes
outage affected 42 million
users.
Azure service was interrupted
for 11hrs, affecting Azure users
world-wide.
Down time of large-scale applications
is very costly
Jan 24th Nov 19thOct 28th
Facebook went down for 35
minutes, losing $854,700.
2014
Gmail’s 25 to 55 minutes
outage affected 42 million
users.
Azure service was interrupted
for 11hrs, affecting Azure users
world-wide.
Down time of large systems is very
costly
Jan 24th Nov 19thOct 28th
Facebook went down for 35
minutes, losing $854,700.
2014
Often caused by
performance problems
5
$1.6 billion loss for a one-second
slowdown
Slow database access is often the
performance bottleneck
6
7
Application-level caches improve
performance
Hibernate
Application server
database
User
Need developers
to manually tell
the frameworks
what should be
cached!
Application-
level caches
Over 67% of Java developers use
Hibernate to access databases
8
22%67%
We focus on Hibernate due to its popularity,
but our approach should be applicable to
other database technologies
An example class with Hibernate code
9
@Entity
@Table(name = “group”)
@Cacheable
public class Group{
@Column(name=“id”)
private int id;
@Column(name=“name”)
String groupName;
String User findGroupById(id){
query = “select g from Group
where g.id = id”;
query.execute().cache();
}
Group.java
User class is
mapped to “group”
table in DB
id is mapped to the
column “id” in the
user table
Query-level cache
(cache query
result)
Object-level cache
(cache retrieval by id)
There can be thousands of possible
cache configurations
10
Optimal cache configuration is often
determined by how users use the application
Caching helps improve performance
11
Group g = findGroupByID(1);
Hibernate
database
App-level
cache
Application server
…
Group g = findGroupByID(1);
Group1
Hibernate
App-level
cache
Sub-optimal cache configurations are
harmful to performance
12
Group u = findGroupByID(1);
database
Application server
g.setName(“FSE”)
Group g = findGroupByID(1);
Group1
…
It is important to understand user behaviors
in order to find the optimal cache
configuration
Problem: Understanding user
behavior in production is very difficult
13
User
Hibernate
Application server
Optimal cache configuration evolves in
production, which requires regular update
Instrumentation
adds too much
overhead!
Our solution: Recover user behaviors by
analyzing readily-available logs
14
User
Source
Code
Application
server Database
CacheOptimizer
Apply optimal
cache config
Update
executable
Overview of CacheOptimizer
15
Source
Code
Database
access
information
Static analysis
Apply static analysis to extract
database access information
16
@Get
@Path(“/group/{id}”)
Group getGroup(id){
getGroupById(id);
…
}
Group getGroupById(id){
select from Group g
where g.id = id …
}
Finding HTTP request handler
methods by analyzing annotations
Apply inter-procedural data flow
analysis to see if inputs from the
HTTP request are used as querying
criteria
Overview of CacheOptimizer
17
Source
Code
Database
access
information
@Get
@Path(‘/group/{id}’)
select from Group u
where g.id = id …
Static analysis
System running in
production
Build
System
10.10.10.1 - -
[11/Apr/2015:12:19:
30] 200 “GET
/app/group/1 ” …
User database
accesses
Example: Recovered database access
18
10.10.10.1 - - [11/Apr/2015:12:19:30]
200 “GET /app/group/1 ”
10.10.10.1 - - [11/Apr/2015:12:19:31]
200 “GET /app/group/2 ”
10.10.10.1 - - [11/Apr/2015:12:19:32]
200 “GET /app/group/1 ”
@Get
@Path(“/group/{id}”)
Group getGroup(id){
…
select from Group g
where g.id = id …
}
Read operation on Group
table, record with id 1, time
is 11/Apr/2015:12:19:30
Read operation on Group
table, record with id 2, time
is 11/Apr/2015:12:19:31
Read operation on Group
table, record with id 1, time
is 11/Apr/2015:12:19:32
Overview of CacheOptimizer
19
Source
Code
Static analysis
System running in
production
Build
System
10.10.10.1 - -
[11/Apr/2015:12:19:
30] 200 “GET
/app/group/1 ” …
User database
accesses
Cache
configuration
Database
access
information
@Get
@Path(‘/group/{id}’)
select from Group u
where g.id = id …
Calculating optimal cache
configuration via workload simulation
20
Incoming
request
Cache hit
Invalidated
cache
Read group with id 1
Update group with id 1
Cache
consideration
No longer
considered for
caching
Time
Miss ratio is ½
(one cache hit)
We keep track of the cache miss ratio for
each potential cache location
Studied applications
Performance
benchmarking
e-commence application
> 35K LOC
Medical record
application
> 3.8M LOC
Simple open-source
application for a pet clinic
3.3K LOC
21
• We use JMeter tests to simulate user
behaviours
• Database is pre-populated with
hundreds of MB of data
Comparing throughput improvements
under different cache configs
22
• CacheAll: Enable all caches
• Default: Cache configurations that are
already added in the application (what
developers think should be cached)
• CacheOptimizer: The optimal cache
config discovered using CacheOptimizer
We compare three different cache configurations
against having no cache (baseline)
CacheOptimizer gives significant
improvements over other configs
23
0%
50%
100%
150%
0%
10%
20%
30%
40%
50%
%ofthroughput
improvementoverhavingnocache
CacheAll DefaultCacheOpt
0%
5%
10%
15%
20%
25%
30%
CacheAll DefaultCacheOpt
CacheAll DefaultCacheOpt
24
25
26
27
28
29
30
31
Tse-Hsun (Peter) Chen
http://petertsehsun.github.io

More Related Content

What's hot

iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...Concordia University
 
Making solubility models with reaxy
Making solubility models with reaxyMaking solubility models with reaxy
Making solubility models with reaxyAnn-Marie Roche
 
Rescuing Data from Decaying and Moribund Clinical Information Systems
Rescuing Data from Decaying and Moribund Clinical Information SystemsRescuing Data from Decaying and Moribund Clinical Information Systems
Rescuing Data from Decaying and Moribund Clinical Information SystemsHealth Informatics New Zealand
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath CommunityRohit Radhakrishnan
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxRohit Radhakrishnan
 
Software Mining and Software Datasets
Software Mining and Software DatasetsSoftware Mining and Software Datasets
Software Mining and Software DatasetsTao Xie
 
Reaxys structure searching
Reaxys structure searchingReaxys structure searching
Reaxys structure searchingAnn-Marie Roche
 

What's hot (10)

iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
 
Making solubility models with reaxy
Making solubility models with reaxyMaking solubility models with reaxy
Making solubility models with reaxy
 
2012 User's Conference Indivo Updates
2012 User's Conference Indivo Updates2012 User's Conference Indivo Updates
2012 User's Conference Indivo Updates
 
Data management
Data managementData management
Data management
 
Data management
Data managementData management
Data management
 
Rescuing Data from Decaying and Moribund Clinical Information Systems
Rescuing Data from Decaying and Moribund Clinical Information SystemsRescuing Data from Decaying and Moribund Clinical Information Systems
Rescuing Data from Decaying and Moribund Clinical Information Systems
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
 
Software Mining and Software Datasets
Software Mining and Software DatasetsSoftware Mining and Software Datasets
Software Mining and Software Datasets
 
Reaxys structure searching
Reaxys structure searchingReaxys structure searching
Reaxys structure searching
 

Similar to FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for Hibernate-based Database-centric Web Applications

Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...Nati Shalom
 
Windows Server 8 Security Improvement
Windows Server 8 Security ImprovementWindows Server 8 Security Improvement
Windows Server 8 Security ImprovementWong Chon Kit
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Hossein Sarshar
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptxFaezNasir
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Dayprogrammermag
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAElynneblue
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Focus on business, not backups
Focus on business, not backupsFocus on business, not backups
Focus on business, not backupsDell World
 
Tech Ed Africa Demystifying Backup Restore In Share Point 2007
Tech Ed Africa Demystifying Backup Restore In Share Point 2007Tech Ed Africa Demystifying Backup Restore In Share Point 2007
Tech Ed Africa Demystifying Backup Restore In Share Point 2007Joel Oleson
 
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02malonzo
 
My Other Computer is a Data Center: The Sector Perspective on Big Data
My Other Computer is a Data Center: The Sector Perspective on Big DataMy Other Computer is a Data Center: The Sector Perspective on Big Data
My Other Computer is a Data Center: The Sector Perspective on Big DataRobert Grossman
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabricMark Ginnebaugh
 
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler Vangorder
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler VangorderEvolving Your Distributed Cache In A Continuous Delivery World: Tyler Vangorder
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler VangorderRedis Labs
 
Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Edureka!
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKyle Hailey
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaJim Plush
 
EPrints and the Cloud
EPrints and the CloudEPrints and the Cloud
EPrints and the CloudLeslie Carr
 
PowerShell-and-DSC-Enables-DSCDevOps-1.pptx
PowerShell-and-DSC-Enables-DSCDevOps-1.pptxPowerShell-and-DSC-Enables-DSCDevOps-1.pptx
PowerShell-and-DSC-Enables-DSCDevOps-1.pptxprabhatthunuguntla
 
Architecting Cloudy Applications
Architecting Cloudy ApplicationsArchitecting Cloudy Applications
Architecting Cloudy ApplicationsDavid Chou
 

Similar to FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for Hibernate-based Database-centric Web Applications (20)

Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
 
Windows Server 8 Security Improvement
Windows Server 8 Security ImprovementWindows Server 8 Security Improvement
Windows Server 8 Security Improvement
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level 
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAE
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Focus on business, not backups
Focus on business, not backupsFocus on business, not backups
Focus on business, not backups
 
Tech Ed Africa Demystifying Backup Restore In Share Point 2007
Tech Ed Africa Demystifying Backup Restore In Share Point 2007Tech Ed Africa Demystifying Backup Restore In Share Point 2007
Tech Ed Africa Demystifying Backup Restore In Share Point 2007
 
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02
Techedafricademystifyingbackuprestoreinsharepoint2007 090805103250 Phpapp02
 
My Other Computer is a Data Center: The Sector Perspective on Big Data
My Other Computer is a Data Center: The Sector Perspective on Big DataMy Other Computer is a Data Center: The Sector Perspective on Big Data
My Other Computer is a Data Center: The Sector Perspective on Big Data
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabric
 
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler Vangorder
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler VangorderEvolving Your Distributed Cache In A Continuous Delivery World: Tyler Vangorder
Evolving Your Distributed Cache In A Continuous Delivery World: Tyler Vangorder
 
Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data Platform
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
EPrints and the Cloud
EPrints and the CloudEPrints and the Cloud
EPrints and the Cloud
 
PowerShell-and-DSC-Enables-DSCDevOps-1.pptx
PowerShell-and-DSC-Enables-DSCDevOps-1.pptxPowerShell-and-DSC-Enables-DSCDevOps-1.pptx
PowerShell-and-DSC-Enables-DSCDevOps-1.pptx
 
Architecting Cloudy Applications
Architecting Cloudy ApplicationsArchitecting Cloudy Applications
Architecting Cloudy Applications
 

Recently uploaded

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for Hibernate-based Database-centric Web Applications

  • 1. CacheOptimizer: Helping Developers Configure Caching Frameworks for Hibernate-based Database-Centric Web Applications 1 Mohamed Nasser, Parminder Flora Tse-Hsun(Peter) Chen Ahmed E. HassanWeiyi Shang
  • 2. – Over 1 billion page views per day – 44 billion SQL executions per day – 8 billion minutes online everyday – Over 1.2 million photos a sec at peak Modern Database-Centric Web Applications: Millions of Users, Billions of Transactions
  • 3. Gmail’s 25 to 55 minutes outage affected 42 million users. Azure service was interrupted for 11hrs, affecting Azure users world-wide. Down time of large-scale applications is very costly Jan 24th Nov 19thOct 28th Facebook went down for 35 minutes, losing $854,700. 2014
  • 4. Gmail’s 25 to 55 minutes outage affected 42 million users. Azure service was interrupted for 11hrs, affecting Azure users world-wide. Down time of large systems is very costly Jan 24th Nov 19thOct 28th Facebook went down for 35 minutes, losing $854,700. 2014 Often caused by performance problems
  • 5. 5 $1.6 billion loss for a one-second slowdown
  • 6. Slow database access is often the performance bottleneck 6
  • 7. 7 Application-level caches improve performance Hibernate Application server database User Need developers to manually tell the frameworks what should be cached! Application- level caches
  • 8. Over 67% of Java developers use Hibernate to access databases 8 22%67% We focus on Hibernate due to its popularity, but our approach should be applicable to other database technologies
  • 9. An example class with Hibernate code 9 @Entity @Table(name = “group”) @Cacheable public class Group{ @Column(name=“id”) private int id; @Column(name=“name”) String groupName; String User findGroupById(id){ query = “select g from Group where g.id = id”; query.execute().cache(); } Group.java User class is mapped to “group” table in DB id is mapped to the column “id” in the user table Query-level cache (cache query result) Object-level cache (cache retrieval by id) There can be thousands of possible cache configurations
  • 10. 10 Optimal cache configuration is often determined by how users use the application
  • 11. Caching helps improve performance 11 Group g = findGroupByID(1); Hibernate database App-level cache Application server … Group g = findGroupByID(1); Group1
  • 12. Hibernate App-level cache Sub-optimal cache configurations are harmful to performance 12 Group u = findGroupByID(1); database Application server g.setName(“FSE”) Group g = findGroupByID(1); Group1 … It is important to understand user behaviors in order to find the optimal cache configuration
  • 13. Problem: Understanding user behavior in production is very difficult 13 User Hibernate Application server Optimal cache configuration evolves in production, which requires regular update Instrumentation adds too much overhead!
  • 14. Our solution: Recover user behaviors by analyzing readily-available logs 14 User Source Code Application server Database CacheOptimizer Apply optimal cache config Update executable
  • 16. Apply static analysis to extract database access information 16 @Get @Path(“/group/{id}”) Group getGroup(id){ getGroupById(id); … } Group getGroupById(id){ select from Group g where g.id = id … } Finding HTTP request handler methods by analyzing annotations Apply inter-procedural data flow analysis to see if inputs from the HTTP request are used as querying criteria
  • 17. Overview of CacheOptimizer 17 Source Code Database access information @Get @Path(‘/group/{id}’) select from Group u where g.id = id … Static analysis System running in production Build System 10.10.10.1 - - [11/Apr/2015:12:19: 30] 200 “GET /app/group/1 ” … User database accesses
  • 18. Example: Recovered database access 18 10.10.10.1 - - [11/Apr/2015:12:19:30] 200 “GET /app/group/1 ” 10.10.10.1 - - [11/Apr/2015:12:19:31] 200 “GET /app/group/2 ” 10.10.10.1 - - [11/Apr/2015:12:19:32] 200 “GET /app/group/1 ” @Get @Path(“/group/{id}”) Group getGroup(id){ … select from Group g where g.id = id … } Read operation on Group table, record with id 1, time is 11/Apr/2015:12:19:30 Read operation on Group table, record with id 2, time is 11/Apr/2015:12:19:31 Read operation on Group table, record with id 1, time is 11/Apr/2015:12:19:32
  • 19. Overview of CacheOptimizer 19 Source Code Static analysis System running in production Build System 10.10.10.1 - - [11/Apr/2015:12:19: 30] 200 “GET /app/group/1 ” … User database accesses Cache configuration Database access information @Get @Path(‘/group/{id}’) select from Group u where g.id = id …
  • 20. Calculating optimal cache configuration via workload simulation 20 Incoming request Cache hit Invalidated cache Read group with id 1 Update group with id 1 Cache consideration No longer considered for caching Time Miss ratio is ½ (one cache hit) We keep track of the cache miss ratio for each potential cache location
  • 21. Studied applications Performance benchmarking e-commence application > 35K LOC Medical record application > 3.8M LOC Simple open-source application for a pet clinic 3.3K LOC 21 • We use JMeter tests to simulate user behaviours • Database is pre-populated with hundreds of MB of data
  • 22. Comparing throughput improvements under different cache configs 22 • CacheAll: Enable all caches • Default: Cache configurations that are already added in the application (what developers think should be cached) • CacheOptimizer: The optimal cache config discovered using CacheOptimizer We compare three different cache configurations against having no cache (baseline)
  • 23. CacheOptimizer gives significant improvements over other configs 23 0% 50% 100% 150% 0% 10% 20% 30% 40% 50% %ofthroughput improvementoverhavingnocache CacheAll DefaultCacheOpt 0% 5% 10% 15% 20% 25% 30% CacheAll DefaultCacheOpt CacheAll DefaultCacheOpt
  • 24. 24
  • 25. 25
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30