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活动进行监控. 它能够对系统的整体情况进行统计,无法对某个进程进行深入分析 ...
随机推荐
- [Swift] Storyboard outlet and action
To programmaictlly change the content of app, we need to contect storyboard to a view controller. To ...
- CSS负边距margin的应用
原文 简书原文:https://www.jianshu.com/p/75a178e65207 相关文章 CSS负margin的影响:https://www.cnblogs.com/shcrk/p/93 ...
- POJ 1775 Sum of Factorials (ZOJ 2358)
http://poj.org/problem?id=1775 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1334 题目大意: ...
- [TypeScript] Understand lookup types in TypeScript
Lookup types, introduced in TypeScript 2.1, allow us to dynamically create types based on the proper ...
- C语言数据类型取值范围解析
版权声明:本文为博主原创文章,未经博主允许不得转载. 为什么int类型的取值范围会是-2^31 ~ 2^31-1 ,为什么要减一呢? 计算机里规定,8位二进制为一个字节,拿byte来说,一个BY ...
- NBU7.0 RMAN 异机恢复 not found in NetBackup catalog
问题描写叙述: RMAN> run { 2> allocate channel t1 type 'sbt_tape'; 3> send 'NB_ORA_SERV=netback ...
- mysqlsla安装
#下载mysqlsla https://github.com/daniel-nichter/hackmysql.com yum install perl-ExtUtils-CBuilder per ...
- Android有用的任务管理器—tractor
在平时的android开发工作中,我们常常须要运行耗时操作,有时为了用户体验还须要显示个等待框,我之前的做法都是开一个线程,然后用handler发消息进行显示和关闭等待框以及相关的ui操作.假设任务比 ...
- 【t073】&&【t015】魔法物品
Time Limit: 1 second Memory Limit: 128 MB [问题描述] 有两种类型的物品:普通物品和魔法物品.每种普通物品有一个价值P,但每种魔法物品有两种价值:鉴定前的价值 ...
- python 使用顺序表实现栈和队列
栈: # -*- coding: utf-8 -*- # @author: Tele # @Time : 2019/04/24 下午 2:33 # 采用list(顺序表)实现栈结构,后入先出 clas ...