性能分析命令之vmstat--mysql

40 篇文章 0 订阅

vmstat

显示虚拟内存的统计信息,还可以报告关于进程、内存、I/O等系统整体运行状态。

选项:

         -a:显示内存活动

         -f:显示启动后创建的进程总数

         -s:以表格方式显示时间计数器和内存状态,不能刷新显示

         -d:显示磁盘状态

         -p:显示指定的分区状态

         -S:指定输出信息的单位

         -n:状态信息刷新的时间间隔和次数

实例:

[root@master~]# vmstat

procs ----------memory------------- --swap--  ---io---  --system-- -----------cpu---------

 r b  swpd  free  buff  cache  si   so  bi bo   in  cs    us  sy  id  wa  st

 0 0   0   23016 62180 304304  0    0  69  30  584145   1    2 95  2   0

 

显示内容分析:

Procs

      r: The number of processes waiting for run time.

      b: The number of processes in uninterruptible sleep.

 

Memory

      swpd: 已用的虚拟内存。.

      free: 空闲的内存.

      buff: 用作buffer的内存.

      cache: 用作 cache的内存.

      inact: 未激活状态的内存inactive memory. (-a option)

      active: 激活状态的内存active memory. (-a option)

 

Swap

      si: 从磁盘交换到内存的内存数量 (/s).

      so: 交换到磁盘的内存数量(/s).

 

IO

      bi: 从块设备接收的块数量 (blocks/s).

      bo: 发送到块设备的块数量 (blocks/s).

 

System

      in: 每秒的中断数量,包括时钟.

      cs: 每秒的上下文切换数量.

 

CPU

      占全部CPU时间的百分比:

      us: 运行非内核(non-kernel)代码花费的时间. (user time, including nice time)

      sy: 运行内核代码花费的时间. (system time)

      id: 空闲时间Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.

      wa: 等待IO的时间. Prior to Linux 2.5.41, included in idle.

      st: 从虚拟机获取的时间. Prior to Linux 2.6.11, unknown.

 

 

[root@master~]# vmstat -s

       547428 total memory

       524908 used memory

       230284 active memory

       247108 inactive memory

        22520 free memory

        62620 buffer memory

       304316 swap cache

      2096472 total swap

            0 used swap

      2096472 free swap

         5071 non-nice user cpu ticks

          199 nice user cpu ticks

        11648 system cpu ticks

       707535 idle cpu ticks

        16799 IO-wait cpu ticks

          195 IRQ cpu ticks

          529 softirq cpu ticks

            0 stolen cpu ticks

       489932 pages paged in

       216337 pages paged out

            0 pages swapped in

            0 pages swapped out

      4337742 interrupts

      1066186 CPU context switches

   1341878613 boot time

        42883 forks

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值