下面是我的服务器htop显示. nginx进程使用CPU时间超过18小时,并以红色显示,但CPU和内存都看起来不错.该值是否在正常范围内?
最佳答案
我对此也很好奇,所以我挖掘了源代码,发现了这个:
if (hours >= 100) {
snprintf(buffer,10,"%7lluh ",hours);
RichString_append(str,CRT_colors[LARGE_NUMBER],buffer);
} else {
if (hours) {
snprintf(buffer,"%2lluh",hours);
RichString_append(str,buffer);
snprintf(buffer,"%02d:%02d ",minutes,seconds);
} else {
snprintf(buffer,"%2d:%02d.%02d ",seconds,hundredths);
}
RichString_append(str,CRT_colors[DEFAULT_COLOR],buffer);
}
因此,看起来每当CPU时间超过一小时时,小时部分就会以红色突出显示(或者CRT_colors [LARGE_NUMBER]恰好是.)
请注意,时间格式会随着时间的推移而变化:
4:33.42是分/秒/毫秒
18:26:41是小时/分钟/秒
101h将是小时> 100