Skip to content

Sapmachine #2392: Add load average to vitals - #2393

Open
schmelter-sap wants to merge 2 commits into
SAP:sapmachinefrom
schmelter-sap:loadavg-in-vitals
Open

Sapmachine #2392: Add load average to vitals#2393
schmelter-sap wants to merge 2 commits into
SAP:sapmachinefrom
schmelter-sap:loadavg-in-vitals

Conversation

@schmelter-sap

Copy link
Copy Markdown
Member

This adds the load average to the vitals.

Since there are actually 3 load average values (taken over 1 minute, 5 minutes or 15 minutes) and the vitals table are already cryz big, this only adds one of the values which is most appropriate for the table (short term or long term).

The load average is given in percent, with 100 percent meaning the system has exactly as many CPUs as runnable threads. This is done so we don't have to know the number of CPUs on the system to see if the system is overloaded.

In principle with the load average added. the "tr" column could be removed, since it is analog to the load average for a very small interval. Since this makes the value fluctuate wildly, not be suitable for the long term table and needs knowing the number of CPUs to interpret it, we could remove it. On the other hand, who knows who uses it and would not be happy to see it removed.

fixes #2392

@MBaesken

Copy link
Copy Markdown
Member

Since there are actually 3 load average values (taken over 1 minute, 5 minutes or 15 minutes) and the vitals table are already cryz big, this only adds one of the values which is most appropriate for the table (short term or long term).

What does it look like?
The column is 'Load average in percent' right? Would it be possible somehow to make it clear in the column name/header etc. that it is a different resolution according to the comment ?

// Use the minute resolution until an age of 2.5 minutes
// and 5 minute resulution until an age of 7.5 minutes.

@MBaesken MBaesken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments/suggestions but seems to be okay.

Comment thread src/hotspot/os/linux/vitals_linux_oswrapper.cpp
Comment thread src/hotspot/share/vitals/vitals.cpp Outdated
value_t load_average;

// Use the minute resolution until an age of 2.5 minutes
// and 5 minute resulution until an age of 7.5 minutes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resulution - little typo

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@MBaesken

Copy link
Copy Markdown
Member

Or why not add all 3 values, if the table is large anyways ?

Comment thread src/hotspot/os/linux/vitals_linux_oswrapper.cpp
MBaesken
MBaesken previously approved these changes Aug 28, 2026
@schmelter-sap

Copy link
Copy Markdown
Member Author

It is currently not possible to change the column header for the different tables. And it would not be easy to change that.

Currently the type of load average used is determined by the resolution of the table. In the short time table the samples are 10 seconds apart, so seeing the 15 minute load average is not really that useful compared to the 1 minute average. On the other hand, in the long term table the sample interval is 1 hour and there the 15 minute average better represents the 1 hour interval than the shorter average.

I think the main question to answer with the load average is: Was the system in the sample interval overloaded? And for this one should look at the load average type which is nearest to the sample interval.

If you're really interested in the type you see, one could annotate the type in the non-raw output. E.g. for a 120 percent load instead of using "120" one could use "120/1", 120/5" or "120/15" .

@ansteiner

Copy link
Copy Markdown
Member

I think tr and tb was used as these are well known metrics from the system e.g. from vmstat. I used them in the past sometimes. Not sure if others rely on these.

value_t rl15 = (value_t) MAX2(0.0, MIN2(65535.0, proc_scale_factor * l15));
// We put the three values into one, since we want to display
// the longer averaged one in table with coarser resolution.
_syst_ldavg = (rl1 << 32) | (rl5 << 16) | rl15;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How meaningful will this be in the "Last 60 minutes section" with 10 seconds interval?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 10 second interval table the 1 minute average will be used, which covers 6 times the sample interval. While not ideal, it is easy to see the general change of the load compared to the previous sample.

@schmelter-sap

Copy link
Copy Markdown
Member Author

I think tr and tb was used as these are well known metrics from the system e.g. from vmstat. I used them in the past sometimes. Not sure if others rely on these.

OK, I will not touch it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add load average to vitals

3 participants