Test learning-102-Fio tool to test server disk read and write performance

Preface

   Under the background of the big data era, data storage has become the current pain point to solve. Major manufacturers have launched their own storage systems, such as Huawei, Tencent, Baidu, etc., although they have cloud services, cloud hosting and other upper-level application products. , But you still need a storage management system designed by yourself on the bottom layer.

This article is to explain the use of disk performance testing tools for storage systems and the writing of scripts

1. Installation of Fio tool on Centos7

    1.1 Fio installation using yum

    1.2 Fio source code installation (offline installation, download the package first) The method used in this article

    For your convenience, I have uploaded the Fio tool, so you can download it yourself.

    Download link: fio2.0.7   https://download.csdn.net/download/u013521274/12706795

    Download link: fio3.7   https://download.csdn.net/download/u013521274/12706806

After the download is complete, you can use winscp and other software to copy the compressed package to a certain directory in Linux. Just drag and drop the VMware virtual machine.

Remarks: You must use the root user. Store the fio toolkit in the directory you created as shown below

1.1 Preparation before installation:

     1. Fio requires gcc environment to run, check whether gcc is installed

     2. Fio operation needs to rely on the package libaio to check whether it is installed

     3. Yum may report an error when installing gcc. Check whether the Centos-Base.repo file is 0 bytes. If it is 0 bytes, you need to download a replacement (backup and replace)

Solution 3:

# cd /etc/yum.repos.d/
# ll -h

//两个命令查看

As shown above, we can see that the Centos-Base.repo file is not 0 bytes. If it is empty, you can download a file of the corresponding version and then replace it.

Download link: http://mirrors.163.com/.help/centos.html 

Note: Make a backup of the .repo file

Solution 2 :

Install libaio

执行          #yum install libaio
如果不行执行  #yum install libaio-devel

Solution 1:

Install gcc

#yum install gcc    

或者

#yum install gcc-c++

 

1.2 Install FIO

#tar -zxvf fio-2.2.10.tar.gz
#cd fio-2.2.10
#./configure
#make  
#make install

解压 编译 安装

  You can also refer to the following figure for installing fio

2. Use the Fio tool to write .sh scripts

     Everyone can use notepad, notepad++ can write

#!/bin/sh

export test=fio
echo "第一个fio测试"
echo $(date +%F%n%T)
fio -directory=/fiorwtest -rw=write -bs=1M -direct=1 -iodepth 2 -ioengine=libaio -size 1G  -thread -numjobs=2  -group_reporting -name=write1m_4job
echo $(date +%F%n%T)
sync

Parameter answer:

 

For more detailed parameter answers, please check other blogs such as: https://blog.csdn.net/qq_14935437/article/details/93749444

Remarks: When scripts written in Windows are transferred to Linux for execution, sometimes errors will be reported because of some special characters.

          Use #cat -A file to check for special characters

3. Execute the .sh file

#sh /etc/liy.sh 
#bash /etc/liy.sh 

//两种都行

 

 

You can leave a message if you have any questions, and you must reply when you see it.

Guess you like

Origin blog.csdn.net/u013521274/article/details/107949362