Actively looking. Java Flight Recorder. How to check what's happen with your service

 Hi, warm community!


Today I want to describe small built-in tool JFR (Java Flight Recorder). How to use the Java Flight Recorder and make a snapshot. 
Let's investigate our instance.
First of all, you need to restart your app (Jira, Confluence, Bitbucket or Bamboo) with next flag for enabling that feature:

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder


Disclaimer:
JMC and JFR are not exactly free software. You cannot use them without a contract with Oracle in a commercial, production environment.

As additionally, I like to enable that option on test env.

-XX:+UnlockDiagnosticVMOption


Well, after that you can start to making a snapshot using jcmd util on the server side.

/usr/java/latest/bin/jcmd 19088 JFR.start delay=10s duration=5m filename=/tmp/recording-without-stats.jfr



Also. you can use various commands:


JFR.start
Start a recording.

JFR.check
Check the status of all recordings running for the specified process, including the recording identification number, file name, duration, and so on.

JFR.stop
Stop a recording with a specific identification number (by default, recording 1 is stopped).

JFR.dump
Dump the data collected so far by the recording with a specific identification number (by default, data from recording 1 is dumped).

Reference:

You can download dump to the local machine and open through JMC (Java mission control) from JDK package.
Hence you can see a panel like this

Then you can choose your record:
On Overview panel you will see that panel with CPU usage and Heap usage overview:


In the section code, you can easier find hot packages and hot classes.


In the section threads, you can find the biggest thread, expand call tree and review hot methods as well.
In the section I/O, on the tab Socket Overview you can easily understand what kind remote host slow, because information like this very helpful


The last thing is


I prefer to make a snapshot with objects stats, which you can enable easier:
To enable that you need to go Template manager and click and enable object statistics and save as own one. 

Upload to server and run like this:


/usr/java/latest/bin/jcmd 19088 JFR.start settings=/tmp/with.stats.jfc delay=10s duration=2m name=Profiling filename=/tmp/recording-with-stats.jfr


Also: you can watch that deep video on how to work with that.
Using Oracle Java Flight Recorder

References:

Hope it helps someone.
To me, it helps to detect very strange apps on Jira.


Cheers,
Gonchik Tsymzhitov

Comments

  1. If the payout channel had crammed up, the payout grew to become extra generous; if nearly empty, the payout grew to become less so . A theoretical hold worksheet is a doc supplied by the producer for each slot machine that indicates the theoretical proportion 코인카지노 the machine should hold based on the quantity paid in. The worksheet additionally indicates the reel strip settings, number of cash that may be|that may be|which may be} played, the payout schedule, the number of reels and different info descriptive of the particular kind of slot machine. A slot machine , fruit machine or poker machine is a gambling machine that creates a recreation of chance for its clients.

    ReplyDelete

Post a Comment

Popular posts from this blog

Let's check installed apps dependency to be compliant for OWASP Dependency-Check

Jira: Housekeeping or continuous cleanup of the Agile activity artifacts

Atlassian Community, let's collaborate and provide stats to vendors about our SQL index usage