Cloud server ECS Linux IO High-footprint troubleshooting method

Source: Internet
Author: User

https://help.aliyun.com/knowledge_detail/41224.html?spm=5176.7841174.2.19.uqC1as# using Iostat to view disk IO load from system latitude IO Load Viewing method
    • View disk IO load from system latitude using Iostat

    • View disk IO load from process latitude using iotop

View disk IO load from system latitude using Iostat

The IO load can be viewed from the system dimension through Iostat.

Iostat is not a common Linux distribution with its own tools, which are included in the Sysstat package and need to be installed by Yum or Apt-get before it can be used. Specific installation Methods This article is no longer detailed.

Usage notes:

    1. 示例用法:iostat -d -k 2# -d 表示,显示设备(磁盘)使用状态。# -k 表示让某些使用 block 为单位的列强制使用 kB 为单位。# 2表示,数据显示每隔2秒刷新一次。示例输出:Linux 3.10.0-123.9.3.el7.x8664 (centos) 06/27/2016 _x86_64 (1 CPU)Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtnxvda 0.58 0.12 3.75 278001 8820028xvdb 0.00 0.00 0.00 740 0xvdc 0.00 0.00 0.00 1388 0xvde 0.00 0.00 0.00 2035 0xvdf 0.00 0.00 0.00 740 0

For more parameters and a description of the returned results, you can refer to Iostat's man help.

View disk IO load from process latitude using iotop

The IO usage of processes within the system can also be sorted by iotop from the process dimension.

Iotop is also not a common Linux distribution with its own tools and needs to be installed before it can be used, such as Yum or Apt-get. Specific installation Methods This article is no longer detailed.

Usage notes:

After running directly with the instruction iotop , you can see a screen similar to the following:

Echo Description:

    • By default, the order is sorted in reverse order of IO usage, and you can use the left and right arrows to manipulate the sorted fields.
    • Press R to toggle the sorting method.
    • Press O to display only the processes that have Disk IO activity.
    • For more parameters and a description of the returned results, you can refer to Iotop's man help.
Operation Case Kjournald process consumes high IO resource issues
  • Problem Description:
    Using Iotop to troubleshoot the analysis, the Kjournald process is found to be consuming a large amount of IO resources.
  • Treatment methods:
    The Kjournald process is the kernel process for the IO data operation of the Ext3 file system, which consumes CPU and memory resources while writing and reading data to disk.
    This problem is usually caused by the Ext3 file system looping the write data, causing the Journal size to grow and then fill up.
    can be done byDUMPE2FSinstruction to view the Journal size configuration for the corresponding partition, and then try to increase the value to see if the problem is mitigated. The Query method is as follows:
    1. $ dumpe2fs/Dev/Xvda1|GrepJournaldumpe2fs 1.42.9 (28-Dec-2013 journal Inode: 8journal Backup: Inode blocksjournal features: journal_incompat_revokejournal size : 128mjournal: 32768journal Sequence: 0x00010ffbjournal Start: 10953

    [[email protected] ~]# DUMPE2FS/Dev/SDA1DUMPE2FS1.39( in-May-2006) Filesystem volume name:/Bootlast Mounted on:<notAvailable>Filesystem uuid:62eed73c-4f24-4250-a69a-2643755cba8afilesystem Magic Number:0xef53Filesystem Revision #:1(dynamic) Filesystem features:has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
          DefaultMount Options:user_xattr aclfilesystem state:cleanerrors behavior:ContinueFilesystem OS Type:linuxinodeCount:76304BlockCount:305200Reserved BlockCount:15260Free blocks:272556Free inodes:76265First block:1Block Size:1024x768Fragment Size:1024x768Reserved GDT Blocks: theBlocks perGroup:8192fragments perGroup:8192inodes perGroup: -Inode blocks perGroup:251Filesystem Created:mon June in  -: -: -  -Last Mount Time:mon Jul -  A: -: to  .Last write Time:mon Jul -  A: -: to  .MountCount:143Maximum MountCount:-1Last Checked:mon June in  -: -: -  -CheckInterval0(<None>) Reserved blocks UID:0(Userroot) Reserved blocks GID:0(Grouproot) First Inode: OneInode Size: -Journal inode:8Defaultdirectory hash:teadirectory Hash SEED:885973FC-263b-466d-8498-e427b59d511ajournalBackup: Inode blocksjournal size:8m ... 

Improve IO performance with 4K alignment

You can format the disk and automatically configure 4K alignment with the following script.

Note: Running this script will automatically format all data disk disks. If you are not purchasing a new disk, be sure to confirm that you have completed the data backup on the relevant disk before you proceed. You can make a backup of the disk through a snapshot, and you can see how to Create a snapshot .

      1. Download Script Auto_fdisk.zip.
      2. After extracting the auto_fdisk.zip, upload the corresponding script to the target server.
      3. Add execute permissions for the script by chmod +x , and so on.
      4. As root, add execute permissions to the script as follows, and then run:
        1. chmod +x ./auto_fdisk.sh./auto_fdisk.sh

Cloud server ECS Linux IO High-footprint troubleshooting method

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.