Our team is monitoring latency of our application using HdrHistograms. When I attach async profiler to it all percentiles increase dramatically.
OS: Red Hat Enterprise Linux release 8.1 (Ootpa)
JVM: 11.0.8-zing_20.08.2.0-b2-product-linux-X86_64
This is what happens if I attach the profiler with flags -i 1000 -t:
This is what happens if I attach the profiler with flags -i 100000 -t:
Decreasing sampling frequency obviously decreases overhead, but it still remains large. I have two questions about it:
- Are there any other ways to decrease the profiling overhead other than reducing sampling frequency? Maybe there are some magical kernel/JVM flags?
- Does this overhead materially distort the profile itself?
Thank you
The profiling interval is in nanoseconds. You can explicitly specify units, e.g.
-i 10ms
. In your case,-i 1000
means 1000 nanoseconds, which is not a sane sampling interval: the process will just do continuous sampling instead of the useful work - and, of course, the result profile will not reflect the realistic picture. Start from the default interval (10ms) and decrease it only if absolutely needed.I have explained the reasonable range in this answer: