使用Ganglia監控整個Hadoop集群,看到Ganglia采集的各種指標:CPU各個具體的指標含義解釋如下:
①CPU(監測到的master主機上的CPU使用情況)
從圖中看出,一共有五個關於CPU的指標。分別如下:
ⓐ User
User表示:CPU一共花了多少比例的時間運行在用戶態空間或者說是用戶進程(running user space processes)。典型的用戶態空間程序有:Shells、數據庫、web服務器……
ⓑ Nice
Nice表示:可理解為,用戶空間進程的CPU的調度優先級,范圍為[-20,19]
You can set the nice value when launching a process with the nice command and then change it with the renice command.
Only the superuser (root) can specify a priority increase of a process.
具體參考:Cpu中的Nice是什么?
ⓒSystem
System的含義與User相似。System表示:CPU花了多少比例的時間在內核空間運行。分配內存、IO操作、創建子進程……都是內核操作。這也表明,當IO操作頻繁時,System參數會很高。
When a user space process needs something from the system, for example when it needs to allocate memory, perform some I/O,
or it needs to create a child process, then the kernel is running
ⓓWait
在計算機中,讀寫磁盤的操作遠比CPU運行的速度要慢,CPU負載處理數據,而數據一般在磁盤上需要讀到內存中才能處理。當CPU發起讀寫操作后,需要等着磁盤驅動器將數據讀入內存(可參考:JAVA IO 以及 NIO 理解),從而導致CPU 在等待的這一段時間內無事可做。CPU處於這種等待狀態的時間由Wait參數來衡量。
cpu is idle while waiting for an I/O operation to complete。The time the CPU spends in this state is shown by the wait statistic.
ⓔIdle
Idel表示:CPU處於空閑狀態時間比例。一般而言,idel + user + nice 約等於100%
此外,Linux中的top命令可實時顯示系統的CPU使用情況。下圖可看出Ganglia的gmond占的cpu還是很多的。
參考文獻:理解Linux cpu 狀態