====== 21 kernelによってvmstat結果が違う ====== ===== CentOS 6.2の場合 ===== ==== カーネル ==== # uname -r 2.6.32-358.14.1.el6.x86_64 ==== 負荷をかける ==== 全CPU100%にする為、わざと無限ループさせる 今回はCPU4つなので、4回実行する。 # python -c "while True: True" & # python -c "while True: True" & # python -c "while True: True" & # python -c "while True: True" & ==== vmstat結果 ==== # vmstat 1 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 5 0 0 247944 8012 186900 0 0 20 6 62 6 5 0 90 0 5 4 0 0 247812 8012 186928 0 0 0 0 3492 63 11 0 88 0 1 4 0 0 247812 8012 186928 0 0 0 0 3488 45 11 0 88 0 2 4 0 0 247812 8012 186928 0 0 0 0 3356 36 10 0 87 0 2 4 0 0 247812 8012 186928 0 0 0 0 3467 38 11 0 87 0 2 ==== top結果 ==== Tasks: 132 total, 5 running, 127 sleeping, 0 stopped, 0 zombie Cpu(s): 11.0%us, 0.0%sy, 0.0%ni, 87.5%id, 0.0%wa, 0.0%hi, 0.0%si, 1.6%st Mem: 666700k total, 418648k used, 248052k free, 7848k buffers Swap: 2097144k total, 0k used, 2097144k free, 186908k cached 1571 root 20 0 112m 3732 1760 R 99.8 0.6 0:09.32 python 1573 root 20 0 112m 3728 1760 R 99.8 0.6 0:07.47 python 1572 root 20 0 112m 3724 1760 R 99.5 0.6 0:07.95 python 1574 root 20 0 112m 3728 1760 R 99.5 0.6 0:06.88 python ==== top結果(CPUごと使用率表示した場合) ==== top後、「1」を押して、CPUごとの使用率を表示させる Tasks: 134 total, 5 running, 128 sleeping, 0 stopped, 1 zombie Cpu0 : 99.7%us, 0.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu1 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu2 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu3 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 666700k total, 574912k used, 91788k free, 11700k buffers Swap: 2097144k total, 0k used, 2097144k free, 323568k cached 1571 root 20 0 112m 3732 1760 R 100.0 0.6 26:38.39 python 1572 root 20 0 112m 3724 1760 R 99.7 0.6 26:37.16 python 1574 root 20 0 112m 3728 1760 R 99.7 0.6 26:34.97 python 1573 root 20 0 112m 3728 1760 R 99.4 0.6 26:36.89 python ===== CentOS 6.0の場合 ===== 同じ事をした場合、CentOS 6.0ではちゃんとvmstatのidleは0になる。 ==== カーネル ==== # uname -r 2.6.18-274.3.1.el5xen ==== vmstat結果 ==== # vmstat 1 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 4 0 0 502296 9012 127460 0 0 30 3 103 15 95 0 4 1 0 4 0 0 502296 9012 127460 0 0 0 0 410 33 100 0 0 0 0 4 0 0 502296 9012 127460 0 0 0 0 410 28 100 0 0 0 0 4 0 0 502296 9012 127460 0 0 0 0 410 34 100 0 0 0 0 ==== top結果 ==== top - 09:35:19 up 21 min, 1 user, load average: 4.00, 3.96, 2.94 Tasks: 105 total, 5 running, 100 sleeping, 0 stopped, 0 zombie Cpu(s):100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1048576k total, 546320k used, 502256k free, 9084k buffers Swap: 2097144k total, 0k used, 2097144k free, 127452k cached 2126 root 25 0 72172 2664 1344 R 100.0 0.3 20:17.04 python 2124 root 25 0 72172 2664 1344 R 100.0 0.3 20:19.48 python 2127 root 25 0 72172 2660 1344 R 100.0 0.3 20:16.56 python 2128 root 25 0 72172 2664 1344 R 99.7 0.3 20:16.12 python ==== top結果(CPUごと使用率表示した場合) ==== top後、「1」を押して、CPUごとの使用率を表示させる Tasks: 105 total, 5 running, 100 sleeping, 0 stopped, 0 zombie Cpu0 : 95.6%us, 0.1%sy, 0.0%ni, 2.6%id, 1.7%wa, 0.0%hi, 0.0%si, 0.0%st Cpu1 : 95.5%us, 0.1%sy, 0.0%ni, 4.1%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st Cpu2 : 95.4%us, 0.1%sy, 0.0%ni, 4.5%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st Cpu3 : 95.4%us, 0.1%sy, 0.0%ni, 4.3%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1048576k total, 546312k used, 502264k free, 9148k buffers Swap: 2097144k total, 0k used, 2097144k free, 127464k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2124 root 25 0 72172 2664 1344 R 100.0 0.3 21:02.59 python 2126 root 25 0 72172 2664 1344 R 100.0 0.3 21:00.12 python 2128 root 25 0 72172 2664 1344 R 100.0 0.3 20:59.23 python 2127 root 25 0 72172 2660 1344 R 97.8 0.3 20:59.65 python