Sysbench fileio

HI,
I am running sysbench fileio for mysql with below command
./sysbench fileio --file-total-size=10G --file-test-mode=rndrw --time=300 --mysql-db=mysql --mysql-host=localhost --mysql-user=root prepare

It generated 128 intermediate test_file.0 , and so on test_file.128.
when I opened these files it shows only character ^@ which is 0x0 means null.

Is all these files are valid? why it is having only NULL character. Could anyone explain it.

When I run it, it is giving all the values as shown below.
./sysbench fileio --file-total-size=10G --file-test-mode=rndrw --time=300 --mysql-db=mysql --mysql-host=localhost --mysql-user=root run
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Extra file open flags: (none)
128 files, 80MiB each
10GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads…

Threads started!

Throughput:
read: IOPS=157.09 2.45 MiB/s (2.57 MB/s)
write: IOPS=104.73 1.64 MiB/s (1.72 MB/s)
fsync: IOPS=335.32

Latency (ms):
min: 0.00
avg: 1.67
max: 139.93
95th percentile: 10.84
sum: 299863.61

Hello @Rahul1526,
Files can be created with a requested size but contain little to no data. This is normal. Sysbench uses the pre-allocated files to do testing.

Your numbers are extremely low. 2.57MB read? SSDs are capable of doing 200+ MB/s. Even spindle HDD can do 80-100MB/s. The latency is fast, which suggests you are using SSDs but the write/read performance is horrible. Try adding --threads 4 to your sysbench and run again.

Thank you Matthew for your response, and sorry for replying so late due to some deliverables.

I still have some more queries:

  1. Is the 128 intermediate file generated by sysbench fileio can be used to feed in other systems or environment as it has null data with size specified.

  2. You have recommended to use --threads=4, i have experimented the same and the IOPS- MB/s is almost same i.e., 2.88. Is something wrong i am performing or it has to do with system as i am using server having 128 cores.

Your response will really will be helpful for me.

Thanks Rahul

  1. No, when you are done with sysbench tests use sysbench fileio --file-total-size=10G cleanup to remove the files.
  2. Run a simpler test dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=sync and see what the speeds are here.This is as low-level of a write-only test that you can do. If this reports slow speeds, then you have something wrong with the hardware. If this is fast, then we need to check our sysbench test.

Rephrasing question 1 - my query was the 128 file which gets generated. I copied in one folder and use it as a dataset to other applications. Will this be a valid, to use it in other applications (not sysbench) as a input file?

#2 suggestion I will experiment it.

I guess? I don’t know what kind of data is inside the sysbench files. Probably random garbage. If your other apps need random garbage, sure go ahead.