SlideShare a Scribd company logo
1 of 21
Memory Kinetics
for
Scale-up and Optimization
Kenny Yu
Session ID: CON5144
a.
A large heap (-Xmx) is not good enough --Excessive GC activitiesPremature tenuringAllocation
failuresOutOfMemoryError
Problems
High throughput
Low pause time
Low cost of GC
Objectives
Objectives explained: Good GC
Approaches
Generational distribution
GC intervals ⇦ Eden + SR
Minimal major GC ⇦ OC
Approaches
Capacity = ArrivalRate * HoldTime
Applicable to subsystems
Eden
Survivor
OldGen
Regardless of distribution of retention time
Fundamentals: Little's Law
1. Optimize GC interval and memory region sizes
Approaches
a. The application is re-designed to polarize the
generational distribution:
Lighter sessions
Long-living caches
Generational hypothesis: enforced
Population
Age
1. 180335.787: [Full GC [PSYoungGen: 57985K->0K(1850304K)]
[PSOldGen: 1945111K->1483937K(2097152K)] 2003097K-
>1483937K(3947456K) [PSPermGen: 263211K->263211K(329728K)],
10.0093850 secs]
180352.182: [GC [PSYoungGen: 1603456K->42582K(1873344K)]
3087393K->1526520K(3970496K), 0.3015250 secs]
!un-optimized
Measure fixed OldGen Utilization size
1.OUfixed = OU on full GC = 1483937K
Survivor copy rate = 42582/0.3 = 142 M/s
Full GC interval = (OC - OUF) / (ΔOU / Δt)
We want to make this 24 hrs.
1. Too brief: excessive overflow to OldGen
Too long: large footprint + long pause
Determine young GC interval
1. To measure: gc-free response time (RT0) at low stress
To set: young gc interval (Tygc) > 4 * RT0
To measure: memory allocation rate under load
Determine Eden Capacity
13714.538: [GC 13714.538: [ParNew: 4399678K->33530K(4806016K), 0.0518020 secs]
5692328K->1326181K(6903168K), 0.0519700 secs] [Times: user=0.15 sys=0.00, real=0.05 secs]
13768.579: [GC 13768.579: [ParNew: 4402682K->27479K(4806016K), 0.0508480 secs] 5695333K-
>1320130K(6903168K), 0.0510040 secs] [Times: user=0.17 sys=0.00, real=0.05 secs]
Δm/Δt = (4 402 682 - 33 530) / (68 - 14) = 80 M/s
EC = Δm/Δt * Tygc = 80M *30 = 2400M
Determine Survivor Capacity
1. set: SC > 2 * max(SU)
1. In our example, SC = 200 M to handle 2x surges.
To measure: Survivor utilization on oversized SC
EU ∝ responses/s
SU ∝ responses/s
Fix Survivor Ratio
1. SurvivorRatio is independent of workload,
It is a property of the application.
1. In our example, 2400M/200M = 12
To measure: overflow rate under load
-- How fast OldGen utilization grows
Determine Promotion Rate
jstat -gc pid 10000 60
S0C S1C S0U S1U EC EU OC OU YGC FGC
436864.0 436864.0 41019.9 0.0 4369152.0 3511510.8 2097152.0 1319641.3 127 4
436864.0 436864.0 0.0 33325.8 4369152.0 197903.8 2097152.0 1319645.8 128 4
436864.0 436864.0 0.0 33325.8 4369152.0 971835.5 2097152.0 1319645.8 128 4
436864.0 436864.0 0.0 33325.8 4369152.0 2003800.7 2097152.0 1319645.8 128 4
436864.0 436864.0 0.0 33325.8 4369152.0 3422374.2 2097152.0 1319645.8 128 4
436864.0 436864.0 48272.6 0.0 4369152.0 1306482.6 2097152.0 1319646.9 129 4
PromoRate = ΔOU/Δt = (6.9-1.3)/50 = 0.11 k/s
With adequate full GC interval (1 day)
Determine Old Gen Capacity
1. SpareOC = PromoRate * 3600 * 24
= 10 M
OC = OUfixed + SpareOC
Summary of approach
Condition Measure Determine
Upon full GC fixed OldGen util OldGen capacity
Low load response time YGC interval
Load to 50% CPU memory alloc rate Eden size
Oversized
survivor
survivor utilization SurvivorRatio
Load, EC, SC promotion rate FGC interval
1. -XX:SurvivorRatio=10 -XX:-
UsePSAdaptiveSurvivorSizePolicy -XX:
+UseConcMarkSweepGC
-XX:+UseParNewGC -XX:
+CMSScavengeBeforeRemark
-XX:CMSInitiatingOccupancyFraction=95 -XX:
+UseCMSInitiatingOccupancyOnly
-Xms7g -Xmx7g -Xmn5g
JVM Memory Configuration
1.Keep constants:
Fixed OldGen utilization
Survivor ratio
CPU speed-dependent
Young GC interval
Proportional to CPU and Throughput:
Eden size
Spare OC
Memory scale-up to faster and more CPUs
1. Full GC once at night
Memory problems resolved
GC pause time 50 ms
Application became CPU-bound
Response time outliers eliminated -- stability
Performance Results
• DIRECTV dev team, led by Bob Hays, Ankush Walhekar and Harsha
Anna, for the application and configuration, and for redesigning the
application for object lifetime management. Jamal Haskins for timely
assistance on build and deploy.
Owen Li, for helping with LoadRunner scripts
Louis Liao for tuning Linux OS
Rao Uppalapati, Prem Chaitanya and Abhiram Madadi, for setting up
environments
DIRECTV for support and providing the equipment and funding the trip
Acknowledgments
• Thank you.
Questions?

More Related Content

Similar to Memory kinetics presentation

IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...Juan C. Vasquez
 
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...aniruudha banhatti
 
Genetic Algo. for Radial Distribution System to reduce Losses
Genetic Algo. for Radial Distribution System to reduce LossesGenetic Algo. for Radial Distribution System to reduce Losses
Genetic Algo. for Radial Distribution System to reduce LossesAbhishek Jangid
 
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...Peter Laurinec
 
Video Compression, Part 2-Section 2, Video Coding Concepts
Video Compression, Part 2-Section 2, Video Coding Concepts Video Compression, Part 2-Section 2, Video Coding Concepts
Video Compression, Part 2-Section 2, Video Coding Concepts Dr. Mohieddin Moradi
 
Some Essentials of TCB
Some Essentials of TCBSome Essentials of TCB
Some Essentials of TCBHugo Pristauz
 
Flywheel Energy Storage
Flywheel Energy StorageFlywheel Energy Storage
Flywheel Energy Storagemichaeljmack
 
Scaling the #2ndhalf
Scaling the #2ndhalfScaling the #2ndhalf
Scaling the #2ndhalfSalo Shp
 
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)Projectproposalon10mwsolarpvpowerplant 160312085340 (2)
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)Muzaffar Ahmad
 
Project Proposal on 10 MW Solar PV Power Plant
Project Proposal on 10 MW Solar PV Power PlantProject Proposal on 10 MW Solar PV Power Plant
Project Proposal on 10 MW Solar PV Power PlantVignesh Sekar
 
Wavelet bootstrap Multiple linear regression models
Wavelet bootstrap Multiple linear regression modelsWavelet bootstrap Multiple linear regression models
Wavelet bootstrap Multiple linear regression modelsVinit Sehgal
 
An Introduction to Statistical Methods and Data Analysis.pdf
An Introduction to Statistical Methods and Data Analysis.pdfAn Introduction to Statistical Methods and Data Analysis.pdf
An Introduction to Statistical Methods and Data Analysis.pdfSandra Valenzuela
 
Part 3 Residuals.pdf
Part 3 Residuals.pdfPart 3 Residuals.pdf
Part 3 Residuals.pdfSajawalNawaz5
 

Similar to Memory kinetics presentation (20)

IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
 
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
 
Genetic Algo. for Radial Distribution System to reduce Losses
Genetic Algo. for Radial Distribution System to reduce LossesGenetic Algo. for Radial Distribution System to reduce Losses
Genetic Algo. for Radial Distribution System to reduce Losses
 
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...
New Clustering-based Forecasting Method for Disaggregated End-consumer Electr...
 
Channelconfih s9
Channelconfih s9Channelconfih s9
Channelconfih s9
 
50 years of size exclusion chromatography
50 years of size exclusion chromatography50 years of size exclusion chromatography
50 years of size exclusion chromatography
 
Msc Thesis Final1
Msc Thesis Final1Msc Thesis Final1
Msc Thesis Final1
 
Video Compression, Part 2-Section 2, Video Coding Concepts
Video Compression, Part 2-Section 2, Video Coding Concepts Video Compression, Part 2-Section 2, Video Coding Concepts
Video Compression, Part 2-Section 2, Video Coding Concepts
 
Some Essentials of TCB
Some Essentials of TCBSome Essentials of TCB
Some Essentials of TCB
 
Flywheel Energy Storage
Flywheel Energy StorageFlywheel Energy Storage
Flywheel Energy Storage
 
Scaling the #2ndhalf
Scaling the #2ndhalfScaling the #2ndhalf
Scaling the #2ndhalf
 
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)Projectproposalon10mwsolarpvpowerplant 160312085340 (2)
Projectproposalon10mwsolarpvpowerplant 160312085340 (2)
 
Project Proposal on 10 MW Solar PV Power Plant
Project Proposal on 10 MW Solar PV Power PlantProject Proposal on 10 MW Solar PV Power Plant
Project Proposal on 10 MW Solar PV Power Plant
 
Wavelet bootstrap Multiple linear regression models
Wavelet bootstrap Multiple linear regression modelsWavelet bootstrap Multiple linear regression models
Wavelet bootstrap Multiple linear regression models
 
Presentation
PresentationPresentation
Presentation
 
An Introduction to Statistical Methods and Data Analysis.pdf
An Introduction to Statistical Methods and Data Analysis.pdfAn Introduction to Statistical Methods and Data Analysis.pdf
An Introduction to Statistical Methods and Data Analysis.pdf
 
Performance Risk Management
Performance Risk ManagementPerformance Risk Management
Performance Risk Management
 
rgDefense
rgDefensergDefense
rgDefense
 
G1GC
G1GCG1GC
G1GC
 
Part 3 Residuals.pdf
Part 3 Residuals.pdfPart 3 Residuals.pdf
Part 3 Residuals.pdf
 

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligencePrecisely
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 

Recently uploaded (20)

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 

Memory kinetics presentation

  • 1. Memory Kinetics for Scale-up and Optimization Kenny Yu Session ID: CON5144
  • 2. a. A large heap (-Xmx) is not good enough --Excessive GC activitiesPremature tenuringAllocation failuresOutOfMemoryError Problems
  • 3. High throughput Low pause time Low cost of GC Objectives
  • 5. Approaches Generational distribution GC intervals ⇦ Eden + SR Minimal major GC ⇦ OC Approaches
  • 6. Capacity = ArrivalRate * HoldTime Applicable to subsystems Eden Survivor OldGen Regardless of distribution of retention time Fundamentals: Little's Law
  • 7. 1. Optimize GC interval and memory region sizes Approaches
  • 8. a. The application is re-designed to polarize the generational distribution: Lighter sessions Long-living caches Generational hypothesis: enforced Population Age
  • 9. 1. 180335.787: [Full GC [PSYoungGen: 57985K->0K(1850304K)] [PSOldGen: 1945111K->1483937K(2097152K)] 2003097K- >1483937K(3947456K) [PSPermGen: 263211K->263211K(329728K)], 10.0093850 secs] 180352.182: [GC [PSYoungGen: 1603456K->42582K(1873344K)] 3087393K->1526520K(3970496K), 0.3015250 secs] !un-optimized Measure fixed OldGen Utilization size 1.OUfixed = OU on full GC = 1483937K Survivor copy rate = 42582/0.3 = 142 M/s Full GC interval = (OC - OUF) / (ΔOU / Δt) We want to make this 24 hrs.
  • 10. 1. Too brief: excessive overflow to OldGen Too long: large footprint + long pause Determine young GC interval 1. To measure: gc-free response time (RT0) at low stress To set: young gc interval (Tygc) > 4 * RT0
  • 11. To measure: memory allocation rate under load Determine Eden Capacity 13714.538: [GC 13714.538: [ParNew: 4399678K->33530K(4806016K), 0.0518020 secs] 5692328K->1326181K(6903168K), 0.0519700 secs] [Times: user=0.15 sys=0.00, real=0.05 secs] 13768.579: [GC 13768.579: [ParNew: 4402682K->27479K(4806016K), 0.0508480 secs] 5695333K- >1320130K(6903168K), 0.0510040 secs] [Times: user=0.17 sys=0.00, real=0.05 secs] Δm/Δt = (4 402 682 - 33 530) / (68 - 14) = 80 M/s EC = Δm/Δt * Tygc = 80M *30 = 2400M
  • 12. Determine Survivor Capacity 1. set: SC > 2 * max(SU) 1. In our example, SC = 200 M to handle 2x surges. To measure: Survivor utilization on oversized SC
  • 13. EU ∝ responses/s SU ∝ responses/s Fix Survivor Ratio 1. SurvivorRatio is independent of workload, It is a property of the application. 1. In our example, 2400M/200M = 12
  • 14. To measure: overflow rate under load -- How fast OldGen utilization grows Determine Promotion Rate jstat -gc pid 10000 60 S0C S1C S0U S1U EC EU OC OU YGC FGC 436864.0 436864.0 41019.9 0.0 4369152.0 3511510.8 2097152.0 1319641.3 127 4 436864.0 436864.0 0.0 33325.8 4369152.0 197903.8 2097152.0 1319645.8 128 4 436864.0 436864.0 0.0 33325.8 4369152.0 971835.5 2097152.0 1319645.8 128 4 436864.0 436864.0 0.0 33325.8 4369152.0 2003800.7 2097152.0 1319645.8 128 4 436864.0 436864.0 0.0 33325.8 4369152.0 3422374.2 2097152.0 1319645.8 128 4 436864.0 436864.0 48272.6 0.0 4369152.0 1306482.6 2097152.0 1319646.9 129 4 PromoRate = ΔOU/Δt = (6.9-1.3)/50 = 0.11 k/s
  • 15. With adequate full GC interval (1 day) Determine Old Gen Capacity 1. SpareOC = PromoRate * 3600 * 24 = 10 M OC = OUfixed + SpareOC
  • 16. Summary of approach Condition Measure Determine Upon full GC fixed OldGen util OldGen capacity Low load response time YGC interval Load to 50% CPU memory alloc rate Eden size Oversized survivor survivor utilization SurvivorRatio Load, EC, SC promotion rate FGC interval
  • 17. 1. -XX:SurvivorRatio=10 -XX:- UsePSAdaptiveSurvivorSizePolicy -XX: +UseConcMarkSweepGC -XX:+UseParNewGC -XX: +CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=95 -XX: +UseCMSInitiatingOccupancyOnly -Xms7g -Xmx7g -Xmn5g JVM Memory Configuration
  • 18. 1.Keep constants: Fixed OldGen utilization Survivor ratio CPU speed-dependent Young GC interval Proportional to CPU and Throughput: Eden size Spare OC Memory scale-up to faster and more CPUs
  • 19. 1. Full GC once at night Memory problems resolved GC pause time 50 ms Application became CPU-bound Response time outliers eliminated -- stability Performance Results
  • 20. • DIRECTV dev team, led by Bob Hays, Ankush Walhekar and Harsha Anna, for the application and configuration, and for redesigning the application for object lifetime management. Jamal Haskins for timely assistance on build and deploy. Owen Li, for helping with LoadRunner scripts Louis Liao for tuning Linux OS Rao Uppalapati, Prem Chaitanya and Abhiram Madadi, for setting up environments DIRECTV for support and providing the equipment and funding the trip Acknowledgments