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
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
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