xiangyuzhi / iobench

C++ I/O library test.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iobench

C++ I/O library test.

Test Disk IO Libraries:

  • pread
  • AIO
  • io_uring
  • spdk

Report

C++ Disk I/O Library Benchmark Report

For AWS linux server

Install liburing.

Install spdk.

Follow the user guide to config your machine and mount device.

Remember to check your nvme SSD device:

sudo lsblk -f

Build

mkdir build
cd build
cmake ..
make

Generate data on disk

mkdir /data
cd build
./gendata /home/ubuntu/dgl/dgl/datasets/file_128MB.bin 128
./gendata /data/file_512MB.bin 512
./gendata /data/file_1GB.bin 1024
stat /data/file_128MB.bin
stat /data/file_512MB.bin
stat /data/file_1GB.bin

Use fio to test and verify your SSD bandwidth:

sudo apt install fio
fio -ioengine=libaio -bs=4k -direct=1 -thread -numjobs=1 -rw=read -filename=/data/file_1GB.bin -name="BS 16KB read test" -iodepth=512 -runtime=20
fio -ioengine=libaio -bs=64k -direct=1 -thread -numjobs=1 -rw=read -filename=/data/file_1GB.bin -name="BS 64KB read test" -iodepth=512 -runtime=20
fio -ioengine=libaio -bs=64k -direct=1 -thread -numjobs=8 -rw=read -filename=/data/file_1GB.bin -name="BS 64KB read test" -iodepth=512 -runtime=20

The bandwidth should between 2000-3500 MB/s.

Usage

$ ./<lib> <file> <is_random_read> <thread_num> <block size>

Or run the script:

bash ./pread_test.sh
bash ./fio_test.sh

Test pread:

./pread /home/ubuntu/dgl/dgl/datasets/file_1GB.bin 0 1 16
./pread /data/file_1GB.bin 0 8 16
./pread /data/file_1GB.bin 0 8 64
./pread /data/file_1GB.bin 1 8 16
./pread /data/file_1GB.bin 1 8 64

Expect output:

5570568009356738390, 2536.537ms, 0.394GB/s
5570568009356738390, 789.062ms, 1.267GB/s
5570568009356738390, 350.578ms, 2.852GB/s
5570568009356738390, 314.861ms, 3.176GB/s

Test aio:

./aio /data/file_1GB.bin 1
./aio /data/file_1GB.bin 8

Expect output:

5570568009356738390, 554.996ms, 1.802GB/s
5570568009356738390, 582.408ms, 1.717GB/s

Test io_uring:

./iouring /data/file_1GB.bin 1
./iouring /data/file_1GB.bin 4
./iouring /data/file_1GB.bin 16

Expect output:

5570568009356738390, 1154.126ms, 0.866GB/s
5570568009356738390, 833.122ms, 1.200GB/s
5570568009356738390, 774.006ms, 1.292GB/s

Test spdk:

About

C++ I/O library test.


Languages

Language:C++ 84.5%Language:Shell 11.4%Language:CMake 4.1%