- Process (cpu, load, threads,…)
- IO (disk and network)
- JVM (memory and garbage collection)
- Application specifics (connection pools, messaging resources length, )
- Business related metrics (Request/response timings)
Configure Java Mission Control to connect to a remote JBoss AS instance
- Edit the “$JAVA_HOME/bin/jmc.ini” file which contains the JVM and JAVA_OPTS related information in this file somewhere at the end users can add the “-Xbootclasspath/a” option to include the “$JBOSS_HOME/bin/client/jboss-client.jar” as following:
-Xbootclasspath/a:/jboss-eap-6.2.0/bin/client/jboss-client.jar <--------NOTICE HERE------>
- Once the “jmc.ini” file is edited as above then Java Mission Control (jmc) can be started as following:
- Then you’ll be able to connect with:
Configure JVM to enable Flight Recording
- $JAVA_HOME/bin/jcmd $JBOSS_PID JFR.start: Starts JFR recording. It returns the recording number, which is used to dump the results to disk
- $JAVA_HOME/bin/jcmd $JBOSS_PID JFR.check: Lists the number of recordings running
- $JAVA_HOME/bin/jcmd $JBOSS_PID JFR.dump recording=<recording_number> filename=<path/file>: Dumps the JFR recording to disk
- $JAVA_HOME/bin/jcmd $JBOSS_PID JFR.stop recording=<recording_number>: Stops the specified JFR recording. This should be done after dumping and not prior.
- $JAVA_HOME/bin/jcmd $JBOSS_PID: help and any of the commands above can be used to list the available options for each command.
$JAVA_HOME/bin/jcmd $JBOSS_PID duration=2h name=MyRecording filename=/tmp/myrecording.jfr
|Scripting all these commands is the best way to make it work, so you can start a recording before doing some tests, and dump the recording when done, so you can analyze it.|
Another JVM Tuning tools
Monitoring the OS
sysstat – sar/ksar
- Input / Output and transfer rate statistics (global, per device, per partition, per network filesystem and per Linux task / PID).
- CPU statistics (global, per CPU and per Linux task / PID), including support for virtualization architectures.
- Memory, hugepages and swap space utilization statistics.
- Virtual memory, paging and fault statistics.
- Per-task (per-PID) memory and page fault statistics.
- Global CPU and page fault statistics for tasks and all their children.
- Process creation activity.
- Interrupt statistics (global, per CPU and per interrupt, including potential APIC interrupt sources, hardware and software interrupts).
- Extensive network statistics: network interface activity (number of packets and kB received and transmitted per second, etc.) including failures from network devices; network traffic statistics for IP, TCP, ICMP and UDP protocols based on SNMPv2 standards; support for IPv6-related protocols.
- NFS server and client activity.
- Socket statistics.
- Run queue and system load statistics.
- Kernel internal tables utilization statistics.
- System and per Linux task switching activity.
- Swapping statistics.
- TTY device activity.
- Power management statistics (instantaneous and average CPU clock frequency, fans speed, devices temperature, voltage inputs, USB devices plugged into the system).
- Filesystems utilization (inodes and blocks).