Linux性能测试 vmstat命令
vmstat命令是最常见的Linux/Unix监控工具,可以展现给定时间间隔的服务器的状态值,包括服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况。这个命令是我查看Linux/Unix最喜爱的命令,一个是Linux/Unix都支持,二是相比top,我可以看到整个机器的CPU,内存,IO的使用情况,而不是单单看到各个进程的CPU使用率和内存使用率(使用场景不一样)。
NAME
vmstat - Report virtual memory statistics
SYNOPSIS
vmstat [-a] [-n] [delay [ count]]
vmstat [-f] [-s] [-m]
vmstat [-S unit]
vmstat [-d]
vmstat [-p disk partition]
vmstat [-V]
Options
The -a switch displays active/inactive memory, given a 2.5. kernel or better.
The -f switch displays the number of forks since boot. This includes the fork, vfork, and clone system calls, and is equivalent to the total number of
tasks created. Each process is represented by one or more tasks, depending on thread usage. This display does not repeat.
The -m displays slabinfo.
The -n switch causes the header to be displayed only once rather than periodically.
The -s switch displays a table of various event counters and memory statistics. This display does not repeat.
delay is the delay between updates in seconds. If no delay is specified, only one report is printed with the average values since boot.
count is the number of updates. If no count is specified and delay is defined, count defaults to infinity.
The -d reports disk statistics (2.5. or above required)
The -p followed by some partition name for detailed statistics (2.5. or above required)
The -S followed by k or K or m or M switches outputs between , , , or bytes
The -V switch results in displaying version information.
一般vmstat工具的使用是通过两个数字参数来完成的,第一个参数是采样的时间间隔数,单位是秒,第二个参数是采样的次数,如:
[root@C44 ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa [root@C44 ~]#
2表示每个两秒采集一次服务器状态,3表示采集三次。
实际上,在应用过程中,我们会在一段时间内一直监控,不想监控直接结束ctrl+c就行了,例如:
[root@C44 ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
vmstat命令输出分成六个部分:
(1)进程procs:
r:在运行队列中等待的进程数 。
b:在等待io的进程数 。
(2)内存memoy:
swpd:现时可用的交换内存(单位KB)。
free:空闲的内存(单位KB)。
buff: 缓冲去中的内存数(单位:KB)。
cache:被用来做为高速缓存的内存数(单位:KB)。
(3) swap交换页面
si: 从磁盘交换到内存的交换页数量,单位:KB/秒。
so: 从内存交换到磁盘的交换页数量,单位:KB/秒。
(4) io块设备:
bi: 发送到块设备的块数,单位:块/秒。
bo: 从块设备接收到的块数,单位:块/秒。
(5)system系统:
in: 每秒的中断数,包括时钟中断。
cs: 每秒的环境(上下文)切换次数。
(6)cpu中央处理器:
cs:用户进程使用的时间 。以百分比表示。
sy:系统进程使用的时间。 以百分比表示。
id:中央处理器的空闲时间 。以百分比表示。
wa:等待IO CPU时间。
Linux性能测试 vmstat命令的更多相关文章
- LINUX系统VMSTAT命令详解
linux系统vmstat命令详解 [转自 https://www.cnblogs.com/wensiyang0916/p/6514820.html] vmstat 1 1表示每秒采集一次vms ...
- [转帖]Linux性能测试 pmap命令
Linux性能测试 pmap命令 https://www.cnblogs.com/txw1958/archive/2012/07/26/linux-pmap.html 名称: pmap - ...
- Linux性能测试分析命令_sar+iostat+vmstat+top
sar主要用于收集并统计系统资源的信息,包括CPU.IO.内存.网卡流量等. vmstat命令主要是对操作系统的虚拟内存.进程.IO读写.CPU活动等整体情况进行统计.但是它不能对某个进程进行深入分析 ...
- Linux性能测试分析命令_vmstat
vmstat命令主要是对操作系统的虚拟内存.进程.IO读写.CPU活动等整体情况进行统计.但是它不能对某个进程进行深入分析. vmstat基本语法 命令使用格式:vmstat [options] [d ...
- Linux监控工具vmstat命令详解
一.前言 很显然从名字中我们就可以知道vmstat是一个查看虚拟内存(Virtual Memory)使用状况的工具,但是怎样通过vmstat来发现系统中的瓶颈呢?在回答这个问题前,还是让我们回 ...
- Linux性能测试分析命令_top
top命令动态展示系统整体资源和各个进程资源占用状况,是Linux下常用的性能分析工具. top命令语法 使用格式:top [-] [d] [b] [H] [p] [q] [c] [C] [S] [s ...
- Linux性能测试 iostat命令
Linux系统出现了性能问题,一般我们可以通过top.iostat.free.vmstat等命令 来查看初步定位问题.其中iostat可以给我们提供丰富的IO状态数据.iostat 由 Red Hat ...
- Linux监控工具vmstat命令
当linux服务器的发生告警,我们要查看当前系统的状态值,包括CPU使用率,内存使用情况,虚拟内存交换情况,IO读写情况等. top与vmstat这两个监控工具都满足要求,当然top还可以看到各个进程 ...
- linux下vmstat命令详解
vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写,可对操作系统的虚拟内存.进程.CPU活动进行监控. 它能够对系统的整体情况进行统计,无法对某个进程进行深入分析 ...
随机推荐
- PL/SQL精明的调用栈分析
PL/SQL精明的调用栈分析 原文:http://www.oracle.com/technetwork/issue-archive/2014/14-jan/o14plsql-2045346.html ...
- thinkphp3.2 图片平均颜色值
public function imgColor($imgUrl) { $imageInfo = getimagesize($imgUrl); //图片类型 $imgType = strtolower ...
- 如何在 BitNami 中创建多个 WEB 应用?(转)
本文最后更新于2015年7月14日,已超过半年没有更新,如果内容失效,请反馈,谢谢! 如您所知,BitNami 为诸多开源 WEB 应用提供集成环境的一键安装解决方案,像著名的开源 WEB 程序 Wo ...
- SpringMVC+Spring+Mybatis+Mysql项目搭建
眼下俺在搭建一个自己的个人站点玩玩.一边练习.一边把用到的技术总结一下,日后好复习. 站点框架大致例如以下图所看到的: 眼下仅仅用到了SpringMVC+Spring+Mybatis+Mysql.把它 ...
- ArcGIS Engine 编辑- IWorkspaceEdit
转自原文 ArcGIS Engine 编辑- IWorkspaceEdit 这个例子中,我创建了1000条要素,并结合缓冲将数据写到文件中,并且添加了时间统计,当然数据是我捏造的,还请原谅,这个花费的 ...
- js进阶正则表达式6转义字符(加\转义)(.符号)(|符号)
js进阶正则表达式6转义字符(加\转义)(.符号)(|符号) 一.总结 转义字符:{} () / $ # & * . ....... //3.特殊字符,都要加转义\ 点符号:var reg2= ...
- 账号权限问题导致 masterha_check_repl 检查失败
在使用 masterha_check_repl --global_conf=/etc/masterha/masterha_default.conf --conf=/etc/masterha/app1. ...
- python property属性
能够检查參数,一直没注意这个语言特性,忽略了非常多细节,感谢 vitrox class Person( object ): def __init__( self, name ): if not isi ...
- Everything starts with a dream(A day has only 24 hours and these things take time,所以要抓紧)
There is the famous quote: "Everything starts with a dream" and many years ago, Michael Va ...
- 【t059】序列
Time Limit: 1 second Memory Limit: 128 MB [问题描述] 生活中,大多数事物都是有序的,因为顺序的美是最令人陶醉的.所以现在RCDH看了不顺的东西就头痛.所以他 ...