日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

linux 跑cpu负载工具,CPU负载查看工具

發(fā)布時(shí)間:2025/4/17 73 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 跑cpu负载工具,CPU负载查看工具 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

uptime

[root@localhost ~]# uptime

15:24:28 up 5:18, 2 users, load average: 0.00, 0.01, 0.05

顯示內(nèi)容說(shuō)明:

15:24:28 #系統(tǒng)當(dāng)前時(shí)間

up 5:18? ? #主機(jī)已運(yùn)行時(shí)間(時(shí)間越長(zhǎng),說(shuō)明越穩(wěn)定)

2 user? ? ? #用戶連接數(shù)(總連接數(shù))

load average: 0.00, 0.01, 0.05? ?# 系統(tǒng)平均負(fù)載,統(tǒng)計(jì)最近1,5,15分鐘的系統(tǒng)平均負(fù)載

注:

如果每個(gè)CPU內(nèi)核的當(dāng)前活動(dòng)進(jìn)程數(shù)小于3,則系統(tǒng)的性能良好。如果每個(gè)CPU內(nèi)核的當(dāng)前進(jìn)程數(shù)大于5,則性能有嚴(yán)重問(wèn)題。

查找CPU使用最多的進(jìn)程

top? ? ?#按大寫P 排序(top本身耗資源,高負(fù)載時(shí)不建議使用)

[root@localhost ~]# top

top - 15:35:16 up 5:28, 2 users, load average: 0.00, 0.01, 0.05

Tasks: 357 total, 2 running, 355 sleeping, 0 stopped, 0 zombie

%Cpu(s): 0.3 us, 0.7 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

KiB Mem : 1003160 total, 123316 free, 145532 used, 734312 buff/cache

KiB Swap: 1048572 total, 1048520 free, 52 used. 635784 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

37994 root 20 0 130156 2028 1268 R 0.7 0.2 0:00.67 top

1 root 20 0 56632 4180 2424 S 0.0 0.4 0:03.68 systemd

2 root 20 0 0 0 0 S 0.0 0.0 0:00.35 kthreadd

3 root 20 0 0 0 0 S 0.0 0.0 0:03.34 ksoftirqd/0

5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H

7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0

8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh

9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0

10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/1

ps? ? # –sort 排序 ,-pcpu 顯示絕對(duì)路徑

[root@localhost ~]# ps -aux --sort -pcpu |head

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 38059 2.6 0.5 403664 5416 ? Sl 15:41 0:00 /usr/libexec/packagekitd

root 762 0.1 0.4 268816 4260 ? Ssl 10:06 0:27 /usr/bin/vmtoolsd

root 1 0.0 0.4 56632 4180 ? Ss 10:06 0:03 /usr/lib/systemd/systemd --switched-root --system --deserialize 24

root 2 0.0 0.0 0 0 ? S 10:06 0:00 [kthreadd]

root 3 0.0 0.0 0 0 ? S 10:06 0:03 [ksoftirqd/0]

root 5 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/0:0H]

root 7 0.0 0.0 0 0 ? S 10:06 0:00 [migration/0]

root 8 0.0 0.0 0 0 ? S 10:06 0:00 [rcu_bh]

root 9 0.0 0.0 0 0 ? S 10:06 0:00 [rcuob/0]

查看CPU信息

[root@localhost ~]# cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 42

model name : Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz

stepping : 7

microcode : 0x29

cpu MHz : 2491.969

cache size : 3072 KB

physical id : 0

siblings : 1

core id : 0

cpu cores : 1

apicid : 0

initial apicid : 0

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tsc_adjust

bogomips : 4983.93

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

查看CPU個(gè)數(shù)

[root@localhost ~]# cat /proc/cpuinfo |grep processor |wc -l

4

查看CPU核心數(shù)

[root@localhost ~]# cat /proc/cpuinfo |grep "core id" |wc -l

8

mpstat? ? #查看CPU運(yùn)行情況

1、安裝

[root@localhost ~]# yum -y install sysstat

2、使用

語(yǔ)法:mpstat [t]? [n]? ? ?#t為更新時(shí)間,n為次數(shù)

[root@localhost ~]# mpstat -P ALL 10 3

Linux 3.10.0-229.el7.x86_64 (localhost.localdomain) 2018年07月17日 _x86_64_ (1 CPU)

16時(shí)23分28秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle

16時(shí)23分38秒 all 0.00 0.00 0.10 0.00 0.00 0.00 0.00 0.00 0.00 99.90

16時(shí)23分38秒 0 0.00 0.00 0.10 0.00 0.00 0.00 0.00 0.00 0.00 99.90

16時(shí)23分38秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle

16時(shí)23分48秒 all 0.10 0.00 0.00 0.00 0.00 0.10 0.00 0.00 0.00 99.80

16時(shí)23分48秒 0 0.10 0.00 0.00 0.00 0.00 0.10 0.00 0.00 0.00 99.80

16時(shí)23分48秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle

16時(shí)23分58秒 all 0.10 0.00 0.30 0.00 0.00 0.00 0.00 0.00 0.00 99.60

16時(shí)23分58秒 0 0.10 0.00 0.30 0.00 0.00 0.00 0.00 0.00 0.00 99.60

平均時(shí)間: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle

平均時(shí)間: all 0.07 0.00 0.13 0.00 0.00 0.03 0.00 0.00 0.00 99.77

平均時(shí)間: 0 0.07 0.00 0.13 0.00 0.00 0.03 0.00 0.00 0.00 99.77

顯示參數(shù)說(shuō)明:

%user :CPU使用占比,不包含nice值為負(fù)進(jìn)程 (usr/total)*100

%nice:低優(yōu)先級(jí)進(jìn)程使用CPU占比,nice值為負(fù)進(jìn)程的CPU時(shí)間(%) (nice/total)*100

%sys :系統(tǒng)使用CPU占比,內(nèi)核時(shí)間(%) (system/total)*100

%iowait :CPU等待IO占比,硬盤IO等待時(shí)間(%) (iowait/total)*100

%irq :CPU處理硬中斷占比,硬中斷時(shí)間(%) (irq/total)*100

%soft :CPU處理軟中斷占比,軟中斷時(shí)間(%) (softirq/total)*100

%idle: CPU空閑占比,閑置時(shí)間(%) (idle/total)*100

溫馨提示:如無(wú)特殊說(shuō)明,本站文章均為作者原創(chuàng),轉(zhuǎn)載請(qǐng)注明出處!

總結(jié)

以上是生活随笔為你收集整理的linux 跑cpu负载工具,CPU负载查看工具的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。