-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x Allow user to influence JFR RecordingStream
used for virtual thread meters
#9652
Comments
Related comment from JIRA 9619
For example , Below are settings for ”jdk.VirtualThreadPinned” event in JDK bundled settings "default" and "profile" . This would means when these settings are used, a Pinned JFR event would be recorded only for cases where the carrier thread was pinned for 20ms or longer.
However many cases the system also run with custom settings via custom JFC file, and can can customise settings for both built-in JDK provided as well as custom defined JFR events. 2 ”jdk.VirtualThreadPinned” JFR events are not generated for all pinning cases. For example carrier thread also get pinned in Java-21 when the vthread mounted on them execute Object.wait(). But these do not generate ”jdk.VirtualThreadPinned”. Same is true for pinning due to blocking operation in class initialiser ( for ex : static blocks), or pining due to certain blocking operation in native code. So primarily, we get pinning events only for blocking operation from sync blocks. |
This enhancement request would address your copied comment # 1 IIUC. Or are you requesting a change or addition to the proposed enhancement? As for your copied # 2 , Helidon would expose what JFR reveals. The specifics of what in the JVM triggers specific events is outside Helidon's control. I will plan to revise the Helidon doc about the virtual thread metrics to emphasize that Helidon is reporting what JFR exposes. I'm not aware of an alternative or additional supported way for Helidon to get further information about pinned threads to fill in the gap you described in the JFR events. If you know of one please share it. |
yes, agree with above comments. one minor detail, the start up options event settings are typically be controlled by two parameters "settings" and "event-settings" -XX:StartFlightRecording=parameter=value The event settings can also be controlled by by parameter "event-settings" Example : Ref : So this would take the settings for event from built-in "default" and later would override few specific settings for certain events. if we are using the settings config passed via command-line to create the RecordingStream it would eb good to consider values provided via both "settings" as well as "event-settings" parameter. |
Yes, there is no programmatic API. Just for information |
As explained in the issue description, Helidon will look up a Helidon config value--not use any JFR command-line values--to find out which JFR configuration name or file path to use for the Helidon's interpretation of the value as a predefined config name or a file path is consistent with the way the JFR command-line value is interpreted, but there is a key reason to use Helidon config and not the JFR command-line option for this purpose: the Helidon virtual threads metrics feature does not require that a JFR recording be in progress. In contrast, on the JFR command line the Of course, Helidon config supports config files and Java system properties and environment variables so a user could specify which config Helidon should use on the command line, just not with the Helidon does not support |
Thanks for clarification. This is important because. "Helidon virtual threads metrics feature does not require that a JFR recording be in progress." In the current implementation from "9619" ,are the vthread related events are recorded in JFR event stream, if. the JVM is started without "StartFlightRecording" option? There is no existing recording in progress, and. no settings are passed while creating the new Recording , what settings are used for vthread events? |
Note that in this PR the default config value for the new Virtual thread events are correctly tracked by the earlier PR and that is unchanged in this PR; you can see the code specifically enables them. |
Experience investigating this has shown that using the default JFR configuration impacts runtime performance, at least to the point that some of our tests failed because requests were seemingly taking too long. (In particular, having the That's too high a performance impact. Further, Helidon's use of JFR to support virtual thread metrics is, primarily, an implementation detail. As a result, Helidon's virtual thread metrics feature will not support the use of JFR configuration files. Helidon metrics creates its own (Users can use whatever JFR configuration they please for actual JFR recordings via the JFR command-line options, in the full knowledge and with the full responsibility that they might thereby be affecting performance. Such usage of JFR is completely separate from Helidon's usage to support virtual threads-related metrics.) As described in the update to the doc, users will be able to configure the behavior of the Helidon virtual metrics feature:
|
RecordingStream
used for virtual thread metersRecordingStream
used for virtual thread meters
The. default settings as part of command line option For ex : "-XX:StartFlightRecording:settings=default,maxsize=50m,maxage=1h" have been in use in production, and do not by themselves add significant overhead. https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/performissues001.html
Do we run into this, if we just use command line option "-XX:StartFlightRecording:settings=default,maxsize=50m,maxage=1h". , but don't actually create a RecordingStream with "default" config? |
I do agree that. Helidon's use of JFR to support virtual thread metrics is, primarily, an implementation detail, and would be good to abstract that. In future implementation can change if vthread data becomes available via MXBeans , that may be preferred compared to using JFR event stream. |
Environment Details
Problem Description
The new support for built-in meters related to virtual threads relies on Java Flight Recorder events. The
RecordingStream
Helidon uses for this currently uses the default JFR configuration settings.This enhancement would allow users to use Helidon config or programmatically to choose which JFR config name or file to use for the
RecordingStream
.Users would be able to choose the configuration by specifying:
.jfc
files are always stored inJAVA_ROOT/lib/jfc
), or.jfc
file.Helidon would interpret the setting as a name first and, if it could not find a JFR configuration by that name, then use it as as path to a
.jfc
file.If Helidon could find neither, or the attempt to load a custom file fails, the server start-up would fail.
The text was updated successfully, but these errors were encountered: