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活动进行监控. 它能够对系统的整体情况进行统计,无法对某个进程进行深入分析 ...
随机推荐
- stm32的timer
- 【u244】山地考察
Time Limit: 1 second Memory Limit: 128 MB [问题描述] 地质学家们打算考察一片山区.这片山区可分成m*n的网格,每个网格都有唯一的海拔高度,山区外围的海拔高度 ...
- Java 学习(20):Java Applet 基础 & Java 文档注释
-- Java Applet 基础 -- Java 文档注释 Java Applet 基础 Applet 是一种 Java 程序.它一般运行在支持 Java 的 Web 浏览器内.因为它有完整的 Ja ...
- Spring boot(一) 入门
本系列基于Eclipse 4.7 .JDK 8 一.下载STS (1)STS 注意自己的eclipse版本. 在 Update Site Archives 里面选择对应eclipse的版本下载. (2 ...
- thinkphp3.1 发送email
//*********************发送邮件************************** Vendor('email'); //******************** 配置信息 * ...
- 【33.33%】【codeforces 552B】Vanya and Books
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Birt
http://www.eclipse.org/birt/ 咖啡图 http://www.kafeitu.me/activiti/2012/05/26/kft-activiti-demo.html
- uva 1519 - Dictionary Size(字典树)
题目链接:uva 1519 - Dictionary Size 题目大意:给出n个字符串组成的字典.如今要加入新的单词,从已有单词中选出非空前缀和非空后缀,组成新单词. 问说能组成多少个单词. 解题思 ...
- 小强的HTML5移动开发之路(40)——jqMobi中实践header定义的几种方式
一.定义全局的header 这个header是所有panel默认的header,需要在<div id="afui">内部,也就是和<div id="co ...
- 【erlang 网络编程学习】 分析cowboy acceptor实现
http://www.tuicool.com/articles/vuymei 不知道为什么就看了cowboy代码,就继续看了下去了. 分析一下吧,主要写写cowboy 的acceptor pool 的 ...