使用 htop 命令时,time+ 列中的红色值是否表示有问题?
When using htop command, do red values in the time+ column mean there's something wrong?
下面是我的服务器htop
显示。 nginx
进程使用了 CPU 时间超过 18 小时,并显示为红色,但 CPU 和内存看起来都正常。数值是否在正常范围内?
很可能只是一种通知方法,可帮助您识别在平均负载中表现出高 cpu 利用率的进程。检查手册页以确定。
我也很好奇这个,所以我研究了源代码,发现了这个:
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);
}
因此,看起来只要 CPU 时间超过一小时,小时部分就会以红色突出显示(或者 CRT_colors[LARGE_NUMBER]
恰好是什么。)
注意时间格式随时间变化:
4:33.42
是 minutes/seconds/millisconds
18h26:41
是 hours/minutes/seconds
101h
将是小时 > 100
下面是我的服务器htop
显示。 nginx
进程使用了 CPU 时间超过 18 小时,并显示为红色,但 CPU 和内存看起来都正常。数值是否在正常范围内?
很可能只是一种通知方法,可帮助您识别在平均负载中表现出高 cpu 利用率的进程。检查手册页以确定。
我也很好奇这个,所以我研究了源代码,发现了这个:
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);
}
因此,看起来只要 CPU 时间超过一小时,小时部分就会以红色突出显示(或者 CRT_colors[LARGE_NUMBER]
恰好是什么。)
注意时间格式随时间变化:
4:33.42
是 minutes/seconds/millisconds
18h26:41
是 hours/minutes/seconds
101h
将是小时 > 100