artwl
artwl

Reputation: 3582

When using htop command, do red values in the time+ column mean there's something wrong?

Below is my server htop display. The nginx process uses CPU time more then 18 hours, and is shown in red color, but CPU and memory all look OK. Is the value within the normal range?

enter image description here

Upvotes: 21

Views: 13465

Answers (2)

James Scriven
James Scriven

Reputation: 8144

I was curious about this too, so I dug into the source code and found this:

if (hours >= 100) {
   snprintf(buffer, 10, "%7lluh ", hours);
   RichString_append(str, CRT_colors[LARGE_NUMBER], buffer);
} else {
   if (hours) {
      snprintf(buffer, 10, "%2lluh", hours);
      RichString_append(str, CRT_colors[LARGE_NUMBER], buffer);
      snprintf(buffer, 10, "%02d:%02d ", minutes, seconds);
   } else {
      snprintf(buffer, 10, "%2d:%02d.%02d ", minutes, seconds, hundredths);
   }
   RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer);
}

So, it looks like whenever the CPU time exceeds one hour, the hour portion is just highlighted in red (or whatever CRT_colors[LARGE_NUMBER] happens to be.)

Notice that the time format changes as the time goes:

4:33.42 is minutes/seconds/millisconds

18h26:41 is hours/minutes/seconds

101h would be hours > 100

Upvotes: 37

James
James

Reputation: 7

Most likely just a notification method to help you identify processes that exhibit high cpu utilization within the load averages. Check the man page to be sure.

Upvotes: 0

Related Questions