我跑了一个很费资源的程序,开始用top看的时候cpu利用率达到9x%,随后用htop看了以下,每核cpu的利用率倒是没超过50%,我该相信谁?
1 [|||||| 6.8%] Tasks: 33, 19 thr; 2 running
2 [|||||||||| 13.0%] Load average: 1.01 0.66 0.28
3 [|||||||||||||||||||||||||||| 36.4%] Uptime: 00:04:34
4 [||||||||||||||| 20.1%]
5 [||||||||||||||||||| 24.8%]
6 [|||||||||||||||||| 23.8%]
7 [|||||||||||||| 17.7%]
8 [|||||| 8.2%]
Mem[|||||| 432/7870MB]
Swp[ 0/0MB]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
1715 root 20 0 995M 99M 2676 S 93.0 1.3 4:05.50 /usr/local/unba/bin/probe
1811 root 20 0 995M 99M 2676 S 33.0 1.3 1:16.48 /usr/local/unba/bin/probe
1813 root 20 0 995M 99M 2676 S 29.0 1.3 0:59.18 /usr/local/unba/bin/probe
1809 root 20 0 995M 99M 2676 S 13.0 1.3 0:46.68 /usr/local/unba/bin/probe
1805 root 20 0 995M 99M 2676 S 13.0 1.3 0:45.78 /usr/local/unba/bin/probe
1899 chenrui 20 0 156M 5044 1308 S 2.0 0.1 0:00.72 mosh-server new -s -c 0
1560 root 20 0 249M 3776 1092 S 2.0 0.0 0:06.95 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
1807 root 20 0 995M 99M 2676 S 2.0 1.3 0:05.11 /usr/local/unba/bin/probe
...
使用了tmux分隔,所以下面的top信息跟htop是同屏显示的,时间是同步的。
top - 00:41:29 up 4 min, 2 users, load average: 1.01, 0.66, 0.28
Tasks: 175 total, 2 running, 173 sleeping, 0 stopped, 0 zombie
Cpu(s): 3.1%us, 2.0%sy, 0.0%ni, 81.6%id, 0.2%wa, 0.1%hi, 12.9%si, 0.2%st
Mem: 8058904k total, 570824k used, 7488080k free, 55012k buffers
Swap: 0k total, 0k used, 0k free, 72820k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1715 root 20 0 995m 99m 2676 S 87.9 1.3 4:04.45 probe
33 root 20 0 0 0 0 S 44.9 0.0 0:32.22 ksoftirqd/7
13 root 20 0 0 0 0 R 37.1 0.0 0:28.72 ksoftirqd/2
17 root 20 0 0 0 0 S 7.8 0.0 0:33.92 ksoftirqd/3
1899 chenrui 20 0 156m 4916 1308 S 5.9 0.1 0:00.70 mosh-server
31 root RT 0 0 0 0 S 2.0 0.0 0:00.01 migration/7
42 root 20 0 0 0 0 S 2.0 0.0 0:00.13 events/7
1560 root 20 0 249m 3776 1092 S 2.0 0.0 0:06.91 rsyslogd
1922 chenrui 20 0 25992 1604 1072 S 2.0 0.0 0:00.04 tmux
1961 root 20 0 110m 2300 1240 S 2.0 0.0 0:00.31 htop
1979 chenrui 20 0 15028 1224 868 R 2.0 0.0 0:00.01 top
1 root 20 0 19232 1484 1192 S 0.0 0.0 0:01.13 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.01 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:29.03 ksoftirqd/0
...
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.