美文网首页
Linux命令行工具——vmstat

Linux命令行工具——vmstat

作者: CokeCode | 来源:发表于2020-08-13 22:02 被阅读0次

    vmstat命令用法:

    vmstat [ <interval> [ <count> ] ]
    

    其中interval是采样间隔,单位为秒,count为采样次数,样例如下:

    darren@DESKTOP-PSPUMSB:~$ vmstat 1 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 6307436   6652  59772    0    0    48  1221    7   24  0  0 100  0  0
     0  0      0 6307436   6652  59772    0    0     0  6144    9   47  0  0 100  0  0
     0  0      0 6307444   6652  59824    0    0     0  4096    6   37  0  0 100  0  0
    

    具体指标的含义如下:

    • procs#r:等待运行的进程数;
    • procs#b:处在非中断睡眠状态的进程数;
    • memory#swpd:虚拟内存使用情况,单位:KB
    • memory#free:空闲内存,单位:KB
    • memory#buff:被用来做缓存的内存,单位:KB
    • memory#cache:
    • swap#si:从磁盘交换到内存的交换页,单位:KB/秒
    • swap#so:从内存交换到磁盘的交换页,单位:KB/秒
    • io#bi:发送到块设备的块数,单位:块/秒
    • io#bo:从块设备接收到的块数,单位:块/秒
    • system#in:每秒的中断数,包括时钟中断
    • system#cs:每秒的上下文切换次数,cs次数高,说明线程、系统上下文切换频繁
    • cpu#us:用户空间CPU使用时间占比,用户CPU占比高,说明用户空间执行计算密集型应用
    • cpu#sy:内核空间CPU使用时间占比
    • cpu#id:CPU空闲时间占比
    • cpu#wa:
    • cpu#st:

    相关文章

      网友评论

          本文标题:Linux命令行工具——vmstat

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