[jbossts-issues] [JBoss JIRA] (JBTM-2364) Include profiler output in benchmark runs

Michael Musgrove (JIRA) issues at jboss.org
Tue Apr 14 15:19:19 EDT 2015


    [ https://issues.jboss.org/browse/JBTM-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059025#comment-13059025 ] 

Michael Musgrove commented on JBTM-2364:
----------------------------------------

In the benchmark scripts there is a set of defaults for the JMH arguments. I have enabled the stack profiler in these defaults. The CI job overrides the defaults so to see profiler output enable it the job config.
 
JMH already supports a number of profilers. To find out which ones are available use the -lprof option. For example:
{code}
java -jar benchmarks.jar -lprof
                  cl: Classloader profiling via standard MBeans
                comp: JIT compiler profiling via standard MBeans
                  gc: GC profiling via standard MBeans
               hs_cl: HotSpot (tm) classloader profiling via implementation-specific MBeans
             hs_comp: HotSpot (tm) JIT compiler profiling via implementation-specific MBeans
               hs_gc: HotSpot (tm) memory manager (GC) profiling via implementation-specific MBeans
               hs_rt: HotSpot (tm) runtime profiling via implementation-specific MBeans
              hs_thr: HotSpot (tm) threading subsystem via implementation-specific MBeans
               stack: Simple and naive Java stack profiler
{code}
There are other supported profilers on linux depending upon whether htop and iotop are installed. I tried enabling the perfasm profile but the benchmarks hang (so if we enable this profiler on a CI slave with these tools installed the benchmarks may hang).

To enable a profiler include -prof <comma separated list of profiler names> in the JMH argument list.

To support other profilers we would need to override org.openjdk.jmh.profile.ExternalProfiler which contains a method called String label(); and this is the name to use in the -prof argument. I have chosen not to add other profilers until we have figured out whether the inbuild stack profiler is sufficient for our needs.

The stack profiler reports stack frames that consume the most CPU. Options include:

-Djmh.stack.lines Number of frames to show (default is 1)
-Djmh.stack.top   Number of stack traces to show (default is 10)
-Djmh.stack.period        How often to take samples (default is 10 ms)
-Djmh.stack.detailLine    Include stack line numbers (default is false)

I have updated the benchmark scripts to pass an environment variable called JVM_ARGS to the JVM the scripts use to run the benchmark.

> Include profiler output in benchmark runs
> -----------------------------------------
>
>                 Key: JBTM-2364
>                 URL: https://issues.jboss.org/browse/JBTM-2364
>             Project: JBoss Transaction Manager
>          Issue Type: Enhancement
>          Components: Performance Testing
>    Affects Versions: 5.0.4
>            Reporter: Michael Musgrove
>            Assignee: Michael Musgrove
>            Priority: Optional
>             Fix For: 5.x.y
>
>
> Benchmarks runs should include profiling data to help diagnose performance issues and find opportunities for performance enhancements.
> The natural choice is Java Flight Recorder (http://www.oracle.com/technetwork/java/javaseproducts/mission-control/java-mission-control-1998576.html)



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jbossts-issues mailing list