C++ I/O library test.
Test Disk IO Libraries:
- pread
- AIO
- io_uring
- spdk
C++ Disk I/O Library Benchmark Report
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
mkdir build
cd build
cmake ..
make
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.
$ ./<lib> <file> <is_random_read> <thread_num> <block size>
Or run the script:
bash ./pread_test.sh
bash ./fio_test.sh
./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
./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
./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