Title: Java Capacity Planning
1Java Capacity Planning Performance Measurements
- Dr. Carl J. De Pasquale
- carl_depasquale_at_adp.com
1
2Java Capacity Planning Performance Measurements
- Agenda
- Capacity vs. Performance
- Java capacity planning
- Java black box
- Tools
- Java application
- Tools
- Performance Measurements
- Coding standards
- Byte code instrumentation
- Method performance measurements using management
library - Method performance measurements using ARM
management library - Tools
- Conclusions
3Java Capacity Planning Performance Measurements
- Hardware Does Not Always Solve Capacity Problems
- Capacity of a given hardware configuration is
subject to the application constraints - Capacity f(Hardware, Application Performance)
- Assume a given hardware configuration
- is 70 utilized,
- Provides a 3 second application response,
- When the arrival rate is two hundred transactions
per second. - Management upgrades the hardware configuration
with one that is twice as fast - What could be the affect on the response time?
3
4Java Capacity Planning Performance Measurements
- What could be the affect on the response time?
- Response Time Could Improve
- If there isnt an application CPU bottleneck
- If there isnt an application threading
bottleneck - If there isnt a network or I/O bottleneck
- Response Time Could Degrade
- Work arrives faster
- Saturates non CPU peripherals
- CPU experiences I/O Waits
- If there is an application threading bottleneck
- If SQL is a poorly written
- More physical I/O executed than required
- table scans/small reads
- If there is a Network Bottleneck
- Small packet size
4
5Java Capacity Planning Performance Measurements
- Black box Java Capacity Planning
- The Java Process
- CPU
- Disk
- Network
- Memory
- No application visibility
- Many java classes running in one JVM
- Application Capacity Planning
- Process java
- Application Class/Method Data
- CPU time by method
- Elapsed time by method
- Method invocation count
- Memory usage heap
- Workflow trace
- SQL timing
5
6Java Capacity Planning Performance Measurements
- Capacity Planning Black Box (java) - No
Application Visibility - Collect process data
- Identify busy period
- Analyze data
- Review reports to identify hot spots
- Computer CPU utilization
- Computer summary
- Disk IO summary
- Network summary
- Memory summary
- Process summary Java will usually be the top
resource consumer
6
7Java Capacity Planning Performance Measurements
- Capacity Planning Black Box (java) - No
Application Visibility - Identify and eliminate all bottlenecks
(analytically) - Apply and monitor changes to physical
infrastructure - Once bottlenecks are eliminated
- Recollect performance data
- Use Analytical modeling to help determine
- Capacity f(Hardware, Application Performance)
- Tools
- Opnet IT GURU
- Hyperformix Capacity Manager
- Team Quest
- Performance Assurance
7
8Java Capacity Planning Performance Measurements
- Application Capacity Planning (java) -
Application Visibility - Coding Standards
- Application Specific Log
- Non standard format
- Each application log must be parsed by capacity
planner - May or may not contain necessary data
- Better than nothing
- Tools
- Byte Code Engineering Library (BCEL)
- Java ClassLoader
8
9Java Capacity Planning Performance Measurements
- Sample Code
- public final class test
- test ()
- public void runtest ()
- for ( int i 0 i lt 9999999 i )
-
- public static void main(String argv)
- try
- for (int i 0 i lt 1 i)
- test t1 new test()
- t1.runtest()
- for (int j 0 j lt 2 j)
- new oohrah ( argv0, argv1 )
-
- catch ( Exception e )
- e.printStackTrace()
-
-
- Sample Code
- public class oohrah
-
- public oohrah( String a, String b )
- spin()
-
- public static void spin()
- int i
- new hello()
- for (i0 i lt 500000000 i)
-
-
- public class hello
-
- public hello( )
- printHello()
-
- public static void printHello()
9
10Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation - JDK 1.5
10
11Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation - JDK 1.5
- Start Class Nametest,Method Name main Elapsed
1180537593616 CPU 515625000 - Start Class Nametest,Method Name runtest Elapsed
1180537593632 CPU 515625000 - End Class Nametest,Method Name runtest Elapsed
1180537593663 CPU 546875000 - ClassNametest runtestCountgt 1
- ClassNametest runtestCpugt 31250000
- ClassNametest mainCountgt 1
- ClassNametest mainCpugt 0
- Start Class Nameoohrah,Method Name spin Elapsed
1180537593679 CPU 562500000 - Start Class Namehello,Method Name printHello
Elapsed 1180537593679 CPU 562500000 - HelloWorld (from hello)
- End Class Namehello,Method Name printHello
Elapsed 1180537593679 CPU 562500000 - ClassNamehello printHelloCountgt 1
- ClassNamehello printHelloCpugt 0
- End Class Nameoohrah,Method Name spin Elapsed
1180537595053 CPU 1890625000 - ClassNameoohrah spinCountgt 1
- ClassNameoohrah spinCpugt 1328125000
- Start Class Nameoohrah,Method Name spin Elapsed
1180537595053 CPU 1890625000 - Start Class Namehello,Method Name printHello
Elapsed 1180537595053 CPU 1890625000
11
12Java Capacity Planning Performance Measurements
- Application Capacity Planning (java) -
Application Visibility - ARM Instrument
- Elapsed time
- Invocation counts
- Correlation
- ArmTransactionsWithMetrics
- CPU time
- Tools
- Byte Code Engineering Library (BCEL)
- Java ClassLoader
12
13Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation - ARM
13
14Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030934 06/13/07
- transaction id02000000 00000000 00000000
00000000 - parent correlator none
- flagsNONE
- application nameApplicationDefinition test
- transaction nameTransactionDefinition
test.main - transaction instance handle1
14
15Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030934 06/13/07
- transaction id04000000 00000000 00000000
00000000 - parent correlator
- length44
- format126
- flags0
- app nameApplicationDefinition test
- app handle1
- tran nameTransactionDefinition test.main
- tran instance id1
- flagsNONE
- application nameApplicationDefinition test
- transaction nameTransactionDefinition
test.runtest - transaction instance handle2
- arm_stop_transaction()
- time030934 06/13/07
15
16Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030934 06/13/07
- transaction id06000000 00000000 00000000
00000000 - parent correlator
- length44
- format126
- flags0
- app nameApplicationDefinition test
- app handle1
- tran nameTransactionDefinition test.main
- tran instance id1
- flagsNONE
- application nameApplicationDefinition oohrah
- transaction nameTransactionDefinition
oohrah.spin - transaction instance handle3
16
17Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030934 06/13/07
- transaction id08000000 00000000 00000000
00000000 - parent correlator
- length44
- format126
- flags0
- app nameApplicationDefinition oohrah
- app handle3
- tran nameTransactionDefinition oohrah.spin
- tran instance id3
- flagsNONE
- application nameApplicationDefinition hello
- transaction nameTransactionDefinition
hello.printHello - transaction instance handle4
17
18Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_stop_transaction()
- time030934 06/13/07
- transaction instance handle4
- transaction statusGOOD
- flagsNONE
- application nameApplicationDefinition hello
- transaction nameTransactionDefinition
hello.printHello - arm_stop_transaction()
- time030935 06/13/07
- transaction instance handle3
- transaction statusGOOD
- flagsNONE
- application nameApplicationDefinition oohrah
- transaction nameTransactionDefinition
oohrah.spin
18
19Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030935 06/13/07
- transaction id0a000000 00000000 00000000
00000000 - parent correlator
- length44
- format126
- flags0
- app nameApplicationDefinition test
- app handle1
- tran nameTransactionDefinition test.main
- tran instance id1
- flagsNONE
- application nameApplicationDefinition oohrah
- transaction nameTransactionDefinition
oohrah.spin - transaction instance handle5
19
20Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_start_transaction()
- time030935 06/13/07
- transaction id0c000000 00000000 00000000
00000000 - parent correlator
- length44
- format126
- flags0
- app nameApplicationDefinition oohrah
- app handle5
- tran nameTransactionDefinition oohrah.spin
- tran instance id5
- flagsNONE
- application nameApplicationDefinition hello
- transaction nameTransactionDefinition
hello.printHello - transaction instance handle6
20
21Java Capacity Planning Performance Measurements
- Dynamic Byte Code Instrumentation ARM
- arm_stop_transaction()
- time030935 06/13/07
- transaction instance handle6
- transaction statusGOOD
- flagsNONE
- application nameApplicationDefinition hello
- transaction nameTransactionDefinition
hello.printHello - arm_stop_transaction()
- time030935 06/13/07
- transaction instance handle5
- transaction statusGOOD
- flagsNONE
- application nameApplicationDefinition oohrah
- transaction nameTransactionDefinition
oohrah.spin - arm_stop_transaction()
- time030935 06/13/07
21
22Java Capacity Planning Performance Measurements
22
23Java Capacity Planning Performance Measurements
- Operational Analysis Method Raw Data Process
23
24Java Capacity Planning Performance Measurements
- Operational Analysis Overloading
- Process ? Method
- Method ? Process
- Valid for
- Black box, and application capacity planning
- Denning, and J. Buzen, The operational analysis
of queuing network models. Computer Surveys,
10(3), 225 - 261 (1978)
24
25Java Capacity Planning Performance Measurements
- Third Party Performance Analysis Tools
- Unable to implement custom application logging
- Unable to implement Dynamic Byte Code
Instrumentation - Third party alternatives
- Mercury
- Opnet Panorama/ACE
- Quest Perform Assure
- Wily
25
26Java Capacity Planning Performance Measurements
- Conclusion
- By adding a bit of sophistication during
application development, performance testing, or
production deployment the often overlooked
non-functional requirement of application
performance requirement can be addressed
26
27Java Capacity Planning Performance Measurements
- Thank You for Attending Have a nice rest of the
day
Questions
Comments
Discussion
27