Performance and Environment Monitoring for Continuous ...€¦ · for Continuous Program...
Transcript of Performance and Environment Monitoring for Continuous ...€¦ · for Continuous Program...
IBM T.J. Watson Research Center
© 2004 IBM Corporation
Performance and Environment Monitoring Performance and Environment Monitoring for Continuous Program Optimizationfor Continuous Program Optimization
Evelyn Duesterwald
Joint work with R. Azimi, C. Cascaval, M. Hauswirth, K. Sudeep, P. F. Sweeney, G. K. Tse, R. W. Wisniewski
IBM TJ Watson Research Center
© 2004 IBM Corporation2 PERCS Continuous Program Optimization September 16, 2004
How to Sustain the Application Performance Growth Curve ?How to Sustain the Application Performance Growth Curve ?
Performance gains from technology advances are diminishing
Complexity of the SW deployment stack is increasing
Execution layers can no longer be optimized in isolation
Need a new methodology for application performance delivery:
Tune entire application deployment stack on-site and on-demand
– Vertical integration
– Continuous and adaptive
Application
App Server
JVM
O/S
Hypervisor
Hardware
Application deployment stack
IBM TJ Watson Research Center
© 2004 IBM Corporation3 PERCS Continuous Program Optimization September 16, 2004
Continuous Program Optimization (CPO) Continuous Program Optimization (CPO) through Performance & Environment Monitoring (PEM) through Performance & Environment Monitoring (PEM)
Continuous Program Optimization (CPO) increases programmer productivity by automating the laborious and challenging performance tuning effort
CPO aims at tuning application by optimally
– adapting the application to its behavior and environment
– adapting environment resources to application behavior
CPO is made possible through continuous whole-system Performance and Environment Monitoring (PEM)
Tune & adapt (CPO)
Monitor & evaluate (PEM)
Continuous optimization loop
IBM TJ Watson Research Center
© 2004 IBM Corporation4 PERCS Continuous Program Optimization September 16, 2004
A Catalogue of CPO ScenariosA Catalogue of CPO Scenarios
Adapting applications to execution behavior and environment — Library Tuning
— Adaptive MPI tuning
— Tuning Just-In-Time (JIT) compiler heuristics
— Interactive tuning environment to support algorithmic tuning
Adapting the execution environment to the application’s needs: — Tuning the Virtual Machine (heap size, GC policies)
— Tuning the operating environment/OS (adaptive page size, adaptive file cache management (FCM))
IBM TJ Watson Research Center
© 2004 IBM Corporation5 PERCS Continuous Program Optimization September 16, 2004
CPO ArchitectureCPO Architecture2 Components to implement CPO scenarios:
PEM: Vertical Performance and Environment Monitoring
Implements programmable monitoring functionality across execution layersProvides integrated whole system view
CPO Agent (Specific to CPO scenario)programs PEM to provide desired monitoring informationImplements specific scenario optimization
There may be several CPO Agents active in the system, interconnected through PEM
Application
App Server
Operating System
Hardware
PE
M
Java VM
Hypervisor
CP
O A
gent
control performance knobnegotiate knob
IBM TJ Watson Research Center
© 2004 IBM Corporation6 PERCS Continuous Program Optimization September 16, 2004
Performance & Environment Monitoring (PEM)Performance & Environment Monitoring (PEM)
Flexible monitoring infrastructure to integrate monitors across execution layers
Platform-independent API (PEMAPI) to program CPO Agents
– CPO Agent for offline event tracing and logging
– CPO Agent for implementing CPO scenarios
Designed to serve as integral part of CPO as well as stand-alone PEM tool set
Application
App Server
Operating System
Hardware
PE
M
Java VM
Hypervisor
CP
O A
gent Event Trace
PEM Trace
Visualizer
IBM TJ Watson Research Center
© 2004 IBM Corporation7 PERCS Continuous Program Optimization September 16, 2004
O/S
PEM InfrastructurePEM Infrastructure 1) Language-independent specification of events and their semantics
2) Generate language-specific event data structures and header files (Java, C, C++, Fortran) to support
Layer instrumentationPEM libraryCPO agent
PE2
VisualizerPEM trace
XML Event specification
PEM Tools
Hardware/SimulatorP
EM
Library
Application
CP
O A
gent
Virtual Machine
3) PEM implementation with a platform-independent API
1
2
3
IBM TJ Watson Research Center
© 2004 IBM Corporation8 PERCS Continuous Program Optimization September 16, 2004
Exploratory Monitoring with PEM Dual-path PEM Tool Set
PEM Trace
PE2 TraceVisualizer
Operating System (K42)
H/W Simulator (Mambo)PEM
C
PO
Agent
New events
Java Apps
Operating System (K42)
Hardware (GP-UL)
PEM
JVM
CP
O
Agent
1) Simulator Path to explorePerformance effects of different solutions
New hardware New monitoring functionality
1) Hardware Path
Explore application performance and identify performance problems
Native Apps
Java Apps
JVM
Native Apps
IBM TJ Watson Research Center
© 2004 IBM Corporation9 PERCS Continuous Program Optimization September 16, 2004
PEM on a Commercial AIX StackPEM on a Commercial AIX Stack
Integrate existing tracing support (e.g., AIX Trace) into PEM monitoring by intercepting existing tracing stream with PEM wrappers
Hypervisor
AIX
JVM (J9)
WebSphere
Java App
H/W
PEM wrapper
PE
M PEM
Trace
PEMAPI event record
J9 Hook function
AIX Trace
PEMAPI event record
PEMAPI event record
IBM TJ Watson Research Center
© 2004 IBM Corporation10 PERCS Continuous Program Optimization September 16, 2004
PEM DemoPEM DemoExploring the Performance Impact of Large PagesExploring the Performance Impact of Large Pages
K42
PE2
Visualizerumt2k PEM
traces
XML event format
PEM Tool
Scripts
GP-ULP
EM
PE
M client
umt2k(scientific,Fortran/C)
Preliminary Work for building a CPO Agent for Adaptive Page Sizing
Vertical Event Traces:App layer: phase markersO/S layer: page faultsHardware layer: PMU counters
IBM TJ Watson Research Center
© 2004 IBM Corporation11 PERCS Continuous Program Optimization September 16, 2004
Complete run of umt2 (initial configuration with 4K pages)
IBM TJ Watson Research Center
© 2004 IBM Corporation12 PERCS Continuous Program Optimization September 16, 2004
Zoom into innermost loop
IBM TJ Watson Research Center
© 2004 IBM Corporation13 PERCS Continuous Program Optimization September 16, 2004
Application instrumentation to trace phase marker events
IBM TJ Watson Research Center
© 2004 IBM Corporation14 PERCS Continuous Program Optimization September 16, 2004
Complete run across OS and H/W metrics (4k pages)
IBM TJ Watson Research Center
© 2004 IBM Corporation15 PERCS Continuous Program Optimization September 16, 2004
Blue – 4k pagesBrown - Initial large 16M page mapping: map data structures of inner loop to large pages (each aligned at large page boundary)
IBM TJ Watson Research Center
© 2004 IBM Corporation16 PERCS Continuous Program Optimization September 16, 2004
Blue – 4k pagesBrown – Initial Large Page Mapping: each structure aligned at large page boundaryRed - Optimized large page mapping: Offset each data structure to avoid conflicts
IBM TJ Watson Research Center
© 2004 IBM Corporation17 PERCS Continuous Program Optimization September 16, 2004
Demo Summary
0.0%
50.0%
100.0%
150.0%
200.0%
time
page
faul
ts
TLB
data
ERA
T
L1 data
small page large page large page opt
IBM TJ Watson Research Center
© 2004 IBM Corporation18 PERCS Continuous Program Optimization September 16, 2004
Conclusions
CPO aims at automatically tuning performance by cross-layer adaptation of code and environment
PEM global vertical monitoring infrastructure
– Integral part of CPO • CPO scenarios are implemented as CPO Agents across the
execution stack
– Stand-alone PEM Tool Set• A CPO Agent for vertical performance exploration and visualization
– Explore application behavior• Hardware-Software Co-design
– Explore effect of new hardware on application performance– Explore new monitoring functionality