首页 / 数据库 / MySQL / mysql中的vmstat性能分析命令
mysql中的vmstat性能分析命令2014-10-28vmstat:显示虚拟内存的统计信息,还可以报告关于进程、内存、I/O等系统整体运行状态。选项:-a:显示内存活动-f:显示启动后创建的进程总数-s:以表格方式显示时间计数器和内存状态,不能刷新显示-d:显示磁盘状态-p:显示指定的分区状态-S:指定输出信息的单位-n:状态信息刷新的时间间隔和次数实例:[root@master~]# vmstatprocs ----------memory------------- --swap-- ---io--- --system-- -----------cpu---------r b swpd free buff cache si so bi bo in cs us sy id wa st0 0 0 23016 62180 304304 0 0 69 30 584145 1 2 95 2 0显示内容分析:Procsr: The number of processes waiting for run time.b: The number of processes in uninterruptible sleep.Memoryswpd: 已用的虚拟内存。.free: 空闲的内存.buff: 用作buffer的内存.cache: 用作 cache的内存.inact: 未激活状态的内存inactive memory. (-a option)active: 激活状态的内存active memory. (-a option)Swapsi: 从磁盘交换到内存的内存数量 (/s).so: 交换到磁盘的内存数量(/s).IObi: 从块设备接收的块数量 (blocks/s).bo: 发送到块设备的块数量 (blocks/s).Systemin: 每秒的中断数量,包括时钟.cs: 每秒的上下文切换数量.CPU占全部CPU时间的百分比:本栏目更多精彩内容:http://www.bianceng.cn/database/MySQL/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 -s547428 total memory524908 used memory230284 active memory247108 inactive memory22520 free memory62620 buffer memory304316 swap cache2096472 total swap0 used swap2096472 free swap5071 non-nice user cpu ticks199 nice user cpu ticks11648 system cpu ticks707535 idle cpu ticks16799 IO-wait cpu ticks195 IRQ cpu ticks529 softirq cpu ticks0 stolen cpu ticks489932 pages paged in216337 pages paged out0 pages swapped in0 pages swapped out4337742 interrupts1066186 CPU context switches1341878613 boot time42883 forks