CentOS 6.5 installation using the Dstat Resource Statistics tool

Source: Internet
Author: User

Directory

    • 1 Use of Dstat tools
      • 1.1 What is Dstat
      • Basic use of 1.2 dstat
        • Default options for 1.2.1 Dstat
        • Common options for 1.2.2 Dstat
      • 1.3 Meaning of the parameters of the detection interface
      • Advanced usage of 1.4 Dstat
        • 1.4.1 Identify the most resource-intensive processes and users
        • 1.4.2 For additional application information
    • 2 Installation of Dstat tools
      • 2.1 (recommended) install via Yum
      • 2.2 (or) installation via wget
      • 2.3 (or) install with RPM
    • 3 Frequently Asked questions in the installation
      • 3.1 Problem Description
      • 3.2 Problem Solving
        • A workaround for 3.2.1 online:
        • 3.2.2 Final Workaround:
1 use of DSTAT Tools 1.1 what is Dstat

Official definition: Multi-function System Resource Statistics generator (versatile tool for generating system resource statistics), which provides tools including top, free, Iostat, Ifstat, Vmstat, and more , the statistical results can also be saved to a CSV file or database.

1.2 Dstat Basic Use 1.2.1 Dstat default options

The data collected by default is collected once a -cpu-、-disk-、-net-、-paging-、-system- second.

The default setting is the same as: dstat -cdngy 1 or dstat -a 1 .

Common options for 1.2.2 Dstat

Using dstat -h the View all option, here's a quick introduction to common options:

# 直接跟数字x, 表示x秒收集一次数据, 默认为一秒-c, --cpu     # 统计CPU状态, 包括 user, system, idle(空闲等待时间百分比), wait(等待磁盘IO)等-d, --disk    # 统计磁盘读写状态-D total,sda  # 统计指定磁盘或汇总信息-m, --mem     # 统计系统物理内存使用情况, 包括used, buffers, cache, free-l, --load    # 统计系统负载情况, 包括1分钟、5分钟、15分钟平均值-s, --swap    # 统计swap已使用和剩余量-n, --net     # 统计网络使用情况, 包括接收和发送数据-N eth1,total # 统计eth1接口汇总流量-r, --io      # 统计I/O请求, 包括读写请求-p, --proc    # 统计进程信息, 包括runnable、uninterruptible、new-y, --sys     # 统计系统信息, 包括中断、上下文切换-t            # 显示统计时间, 对分析历史数据非常有用--fs          # 统计文件打开数和inodes数

Common use combinations are:

dstat -cmsdnl -D sda9 -N lo,etho 100 5

1.3 Meaning of the parameters of the detection interface
----system---- # 系统时间信息
---procs---    # 进程数统计run: 运行中的和等待(CPU时间片)运行的进程数 --- 此值若长期大于1, 可考虑增加CPUblk: 处于不可中断状态的进程数, 多由 IO 引发new: 系统内核进程消耗的CPU时间百分比, 若值太高, 说明系统可能出现故障, 需检查排除
----total-cpu-usage---- # CPU使用率usr: 用户进程消耗的CPU时间百分比sys: 系统内核进程消耗的CPU时间百分比, 若值太高, 说明系统可能出现故障, 需要检查idl: CPU处在空闲状态的时间百分比wai: 等待磁盘I/O所消耗的CPU时间百分比, 值越高, 说明IO等待严重, 可能是磁盘大量随机访问造成, 也可能是磁盘的带块出现瓶颈(块操作)hiq: hardware interrupt, 硬件中断次数siq: software interrupt, 软件中断次数
-----memory-usage-----  # 内存使用率used: 当前已使用的内存buff: 作为buffer cache的内存, 对块设备的读写进行缓冲cache: 作为page cache的内存, 文件系统的cache. cache越大, 说明cache中的文件数多. # 如果频繁访问到的文件都能被载入cache, 那么磁盘的读IO将会显著降低free: 空闲的物理内存
---io/total---      # 磁盘IO统计read: 从块设备读入的数据总量(读磁盘)(单位: KB/s)writ: 写入到块设备的数据总量(写磁盘)(单位: KB/s)# 注: 随机磁盘读写时, 这两个参数的值越大(如超出1M), CPU消耗在IO等待的时间就越长
-dsk/total-         # 磁盘统计read: 读总数writ: 写总数
-net/total-         
---paging---        
---load-avg---      
1.4 Dstat Advanced Usage 1.4.1 Identify the most resource-intensive processes and users

Usage:--top-(io|bio|cpu|cputime|cputime-avg|mem)

The above command allows you to view specific users and their processes that occupy the relevant system resources.

Example: View the command that currently consumes the highest IO, CPU, and memory process information:

dstat --top-io --top-mem --top-cpu
1.4.2 For additional application information

Dstat can also obtain additional application information. Such as:

dstat --postfix   # 显示postfix队列大小dstat --sendmail  # 显示sendmail队列大小dstat --ntp       # 显示ntp服务器时间
2 installation of DSTAT Tools 2.1 (recommended) install via Yum

It is recommended that you use any of the paths without configuring other environments :

yum install dstat
2.2 (or) installation via wget

First install the Wget tool:

yum -y install wget

Then install the Dstat tool:

wget http://dstat.sourcearchive.com/downloads/0.7.0/dstat_0.7.0.orig.tar.gz# 解压, 然后进入解压后的目录: tar -xvzf dstat_0.7.0.orig.tar.gzcd dstat-0.7.0.orig/# 使用以下方式即可使用dstat./dstat -V
2.3 (or) install with RPM
wget http://mirror.centos.org/centos/6/os/i386/Packages/dstat-0.7.0-2.el6.noarch.rpmrpm -ivh dstat-0.7.0-2.el6.noarch.rpm# 直接在系统中调用dstat即可dstat -V
3 FAQ in Installation 3.1 Description of the problem

In the CentOS 6.5 system, you are ready to install the Dstat tool using the Yum or wget command and find that both are not available:

    • Yum Command error:

      Loaded plugins: fastestmirrorCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"Error: Cannot find a valid baseurl for repo: base
    • wget Command error:

      -bash: wget: command not found
3.2 Problem Solving

After searching for a lap, the problem is that the server failed to connect successfully to the extranet, and the detection method: The following test on the command line:
ping www.baidu.com# Unable to find www.baidu.com host, description not connected to Internet.

A workaround for 3.2.1 online:

(1) Login with root
(2) Input: Vi/etc/systemconfig/network-scripts/ifcfg-eth0
(3) Add dns1=8.8.8.8 in this document
(4) then save
(5) Service Network Restart # Restart Web Services
(6) Yum install gcc # normal download

I did not find the path on my server systemconfig , let alone the ifcfg-eth0 file ...

3.2.2 Final Workaround:
# 编辑/etc/resolv.conf文件:vi /etc/resolv.conf# 向其中添加: nameserver 8.8.8.8# 保存退出即可

At this point ping www.baidu.com , the discovery can be ping--problem solved.

Reference:

Https://www.cnblogs.com/vincent-hv/p/3358194.html

Copyright Notice

Author: Ma_shoufeng (Ma Ching)

Source: Blog Park Ma Ching's Blog

Your support is a great encouragement to bloggers, thank you for your reading.

The copyright of this article is owned by bloggers, welcome reprint, but without the blogger agreed to retain this paragraph statement, and in the article page obvious location to the original link, otherwise Bo Master reserves the right to pursue legal responsibility.

CentOS 6.5 installation using the Dstat Resource Statistics tool

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.