Disco, CPU, la memoria, la carga

1. disco

1. df -hl : el uso del disco Ver

[root@linux-node1 ~]# df -hl
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root   37G  2.9G   35G   8% /
devtmpfs             898M     0  898M   0% /dev
tmpfs                910M   16K  910M   1% /dev/shm
tmpfs                910M   34M  877M   4% /run

2. df -h / Inicio : Ver el uso del disco directorio especificado

[root@linux-node1 ~]# df -h /home
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root   37G  2.9G   35G   8% /

3. du -SH ./* | grep G : archivo para ver el archivo carpeta directorio actual más grande que 1G

[root@linux-node1 /]# du -sh ./*|grep G
2.2G    ./usr
1.2G    ./home

4. Buscar / M + -tamaño de tipo 100M 10M -tamaño -print0 -a | xargs -0 du -H | -NR Ordenar
: Encuentra archivos de más de 10 millones menos de 100 metros, el orden inverso

[root@linux-node1 /]# find / -type f -size +10M -a -size -100M  -print0 | xargs -0 du -h | sort -nr
85M     /usr/bin/docker
80M     /var/lib/rpm/Packages
48M     /usr/bin/containerd
47M     /boot/initramfs-0-rescue-8b956f09fe0549c4b6182589acceab30.img

find / -type f -size +10M -a -size -100M   # 查找根文件夹下大于 10M小于 100M

2. CPU

1. Inicio : Ver el uso de la CPU, etc.

[root@linux-node1 /]# top
top - 03:24:29      # 表示当前时间
up 4 days, 22:56,   # 系统已经运行时间 
2 users,            # 当前登录用户数
load average: 0.01, 0.03, 0.05  # 系统负载,即任务队列的平均长度。 三个数值分别为 1分钟、5分钟、15分钟前到现在的平均值
Tasks: 123 total(进程总数),   2 running(正在运行进程数), 121 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 
us,  0.0  # 用户空间占用CPU百分比
sy,  0.0  # 内核空间占用CPU百分比
ni,100.0  # 用户进程空间内改变过优先级的进程占用CPU百分比
id,  0.0  # 空闲CPU百分比
wa,  0.0  # 等待输入输出的CPU时间百分比
hi,  0.0  # 硬中断(Hardware IRQ)占用CPU的百分比
si,  0.0  # 软中断(Software Interrupts)占用CPU的百分比
st
KiB Mem :  1863224 total(物理内存总量),   219592 free,   498732 used,  1144900 buff/cache
KiB Swap:  2097148 total(交换区总量),  2094580 free,     2568 used.  1043628 avail Mem
    
进程id 进程所有者  优先级  
 PID    USER       PR      RES    SHR S %CPU %MEM     TIME+ COMMAND                                          
6583    root       20      5156   3796 S  0.3  0.3  10:54.90 vmtoolsd       
7284    root       20      2252   1580 R  0.3  0.1   0:00.03 top                 
   1    root       20      3844   2436 S  0.0  0.2   2:04.28 systemd      

2. SAR -u 1 5. : Uso de la CPU recogió una vez por segundo se recogieron 5

[root@linux-node1 /]# yum install sysstat  # 安装sar工具
[root@linux-node1 /]# sar -u 1 5  # 每1秒采集一次CPU使用率,共采集5次
03:58:40 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
03:58:41 AM     all      0.00      0.00      3.61      0.00      0.00     96.39
03:58:42 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
03:58:43 AM     all      0.00      0.00      0.00      0.00      0.00    100.00
Average:        all      0.00      0.00      0.62      0.00      0.00     99.38

3. cat / proc / cpuinfo : Ver información básica acerca de la CPU

[root@linux-node1 ~]# cat /proc/cpuinfo
processor       : 0                # 系统中逻辑处理核的编号
vendor_id       : GenuineIntel     # CPU制造商 
cpu family      : 6                # CPU产品系列代号
model           : 142              # CPU属于其系列中的哪一代的代号
model name      : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz   # CPU属于的名字及其编号、标称主频
stepping        : 9                # CPU属于制作更新版本
cache size      : 4096 KB          # CPU二级缓存大小
physical id     : 0                # 单个CPU的标号
siblings        : 1                # 单个CPU逻辑物理核数          
cpu cores       : 1                # cpu个数

4. cat / proc / cpuinfo | grep "FÍSICA lo anterior Identificación del mencionado" | el tipo | uniq | WC la -l : Ver el número de CPU

[root@linux-node1 ~]# cat /proc/cpuinfo
processor       : 0                # 系统中逻辑处理核的编号
vendor_id       : GenuineIntel     # CPU制造商 
cpu family      : 6                # CPU产品系列代号
model           : 142              # CPU属于其系列中的哪一代的代号
model name      : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz   # CPU属于的名字及其编号、标称主频
stepping        : 9                # CPU属于制作更新版本
cache size      : 4096 KB          # CPU二级缓存大小
physical id     : 0                # 单个CPU的标号
siblings        : 1                # 单个CPU逻辑物理核数          
cpu cores       : 1                # cpu个数

3. memoria

1. Como libres -m : detalles de la memoria consulta

[root@linux-node1 ~]# free -m
              total        used        free      shared              buff/cache   available
Mem:           1819         486         190          32                1142        1020
Swap:          2047           2        2045
              总内存       已使用       可用空间    多进程共享内存        磁盘缓存大小

2. CAT / proc / meminfo : la memoria Ver detalles

[root@linux-node1 ~]# cat /proc/meminfo
MemTotal:        1863224 kB
MemFree:          195568 kB
MemAvailable:    1044924 kB
Buffers:               0 kB

3. vmstat : Ver la memoria

[root@linux-node1 shdir]# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0   2568 181696      0 1057272    0    0     9    52  107  155  2  1 97  0  0
 
r   # 表示运行队列(就是说多少个进程真的分配到CPU),当这个值超过了CPU数目,就会出现CPU瓶颈了。
b   # 表示阻塞的进程,这个不多说,进程阻塞,大家懂的。
swpd   # 虚拟内存已使用的大小,如果大于0,表示你的机器物理内存不足了
free   #空闲的物理内存的大小,我的机器内存总共8G,剩余3415M。
buff   # 用来存储目录里面有什么内容,权限等的缓存,我本机大概占用300多M
cache  # cache直接用来记忆我们打开的文件,给文件做缓冲
si     # 每秒从磁盘读入虚拟内存的大小,如果这个值大于0,表示物理内存不够用或者内存泄露了,要查找耗内存进程解决掉。
so     # 每秒虚拟内存写入磁盘的大小,如果这个值大于0,表示物理内存不够用或者内存泄露了,要查找耗内存进程解决掉。
bi     # 块设备每秒接收的块数量,当处理拷贝大量数据(2-3T)的机器上看过可以达到140000/s,磁盘写入速度差不多140M每秒
bo     # 块设备每秒发送的块数量,例如我们读取文件,bo就要大于0。bi和bo一般都要接近0,不然就是IO过于频繁,需要调整。
in     # 每秒CPU的中断次数,包括时间中断
cs     # 每秒上下文切换次数,例如我们调用系统函数,就要进行上下文切换,线程的切换,也要进程上下文切换,这个值要越小越好

us  # 用户CPU使用百分比
sy  # 系统CPU使用百分比
id  # idle(空闲CPU百分比),一般来说,id + us + sy = 100,一般我认为id是空闲CPU使用率,us是用户CPU使用率,sy是系统CPU使用率。
wt  # 等待IO CPU时间(大于0代表系统资源不足)

4. la -s vmstat : detalles de uso de memoria

[root@linux-node1 ~]# vmstat -s
      1863224 K total memory
       497780 K used memory
       599272 K active memory
       620812 K inactive memory
       188652 K free memory
            0 K buffer memory
      1176792 K swap cache
      2097148 K total swap
         2568 K used swap
      2094580 K free swap
       608294 non-nice user cpu ticks
          625 nice user cpu ticks
       539067 system cpu ticks
     63631049 idle cpu ticks
        15051 IO-wait cpu ticks
            0 IRQ cpu ticks
        10324 softirq cpu ticks
            0 stolen cpu ticks
       420669 pages paged in
      3118282 pages paged out
            7 pages swapped in
          627 pages swapped out
     73440819 interrupts
    111933117 CPU context switches
   1574604468 boot time
      1097163 forks

4. carga

¿Cuál es la carga media en el sistema?

# 1. 系统平均负载是指在特定时间间隔内运行队列中的平均进程数。
# 2. 如果每个CPU内核的当前活动进程数不大于3的话,那么系统的性能是良好的。
# 3. 如果每个CPU内核的任务数大于5,那么这台机器的性能有严重问题。
# 4. 如果你的linux主机是1个双核CPU的话,当Load Average 为6的时候说明机器已经被充分使用了。
# 5. 1可以被认为是最优的负载值。负载是会随着系统不同改变得。
# 6. 单CPU系统1-3和SMP系统6-10都是可能接受的。

1. El tiempo de actividad : sistema de consulta de información de carga actual

[root@linux-node1 ~]# uptime
 21:03:50 up 5 days,  5:14,  2 users,  load average: 0.02, 0.04, 0.05

'''显示内容说明:'''
10:19:04             # 系统当前时间 
up 257 days, 18:56   # 主机已运行时间,时间越大,说明你的机器越稳定。 
12 user              # 用户连接数,是总连接数而不是用户数 
load average         # 系统平均负载,统计最近1,5,15分钟的系统平均负载

2. / proc / CAT loadavg información Comprobar carga:

[root@linux-node1 ~]# cat /proc/loadavg 
0.00 0.01 0.05 2/384 4482

# 0.00 0.01 0.05 表示最近1分钟,5分钟,15分钟 系统的平均负载; 系统负载越高,代表CPU越繁忙;
# 2/384 2代表此时运行队列中的进程个数;384 代表系统中进程的总数
# 4482 代表到此为止创建的最后一个进程的ID.
Publicado 84 artículos originales · ganado elogios 1 · vistas 2055

Supongo que te gusta

Origin blog.csdn.net/lxp_mocheng/article/details/104907832
Recomendado
Clasificación