美文网首页
Linux高级

Linux高级

作者: 笨比乔治 | 来源:发表于2020-11-26 22:24 被阅读0次

1.查看整体机器性能
top
1.1 cpu
1.2 mem 内存
1.3 id = idle cpu空闲 值越高越好
command 是那个进程
load average 系统负载率 有三个值 分别是1分钟 5 分钟 15分钟平均负载

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# uptime
 21:24:35 up 80 days,  7:34,  1 user,  load average: 0.00, 0.02, 0.05

2.内存

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# free `字节`
              total        used        free      shared  buff/cache   available
Mem:        3880172     1016728      188492         900     2674952     2573176
Swap:             0           0           0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# free -g    `G`
              total        used        free      shared  buff/cache   available
Mem:              3           0           0           0           2           2
Swap:             0           0           0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3789         992         184           0        2612        2513
Swap:             0           0           0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# 

3.硬盘

df diskfree -h 人类的读法

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# df
Filesystem     1K-blocks     Used Available Use% Mounted on
devtmpfs         1929724        0   1929724   0% /dev
tmpfs            1940084        0   1940084   0% /dev/shm
tmpfs            1940084      604   1939480   1% /run
tmpfs            1940084        0   1940084   0% /sys/fs/cgroup
/dev/vda1       41152812 11318796  27930308  29% /
tmpfs             388020        0    388020   0% /run/user/0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  604K  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/vda1        40G   11G   27G  29% /
tmpfs           379M     0  379M   0% /run/user/0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# 

vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写,可对操作系统的虚拟内存、进程、CPU活动进行监控。是对系统的整体情况进行统计,不足之处是无法对某个进程进行深入分析。
us+sy/id

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# vmstat -n 2 3
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      0 188220 294612 2380320    0    0     0     4    2    0  2  0 98  0  0
 0  0      0 188220 294612 2380352    0    0     0     6  708 1034  3  1 97  0  0
 0  0      0 187692 294612 2380352    0    0     0    34  895 1208  3  1 97  0  0
[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# 

io

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# iostat -xdk 2 3
Linux 3.10.0-1062.18.1.el7.x86_64 (iZ2ze9gr4nii3y49a2wlx9Z)     10/29/2020  _x86_64_    (2 CPU)

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
vda               0.00     0.71    0.01    0.77     0.27     8.18    21.66     0.00    5.41    5.51    5.41   0.25   0.02

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
vda               0.00     0.00    0.50    0.50     4.00     2.00    12.00     0.00    0.50    1.00    0.00   0.50   0.05

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
vda               0.00     4.50    0.00    3.50     0.00    36.00    20.57     0.00    0.29    0.00    0.29   0.29   0.10

[root@iZ2ze9gr4nii3y49a2wlx9Z ~]# 

chomd

相关文章

网友评论

      本文标题:Linux高级

      本文链接:https://www.haomeiwen.com/subject/ahvlvktx.html