axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.23k stars 1.26k forks source link

Sharing files between threads #631

Open xldrx opened 6 years ago

xldrx commented 6 years ago

I am trying to share files between threads with no success. The following fio file works perfectly:

[global]
filename_format=data-$jobnum-$filenum.bin
filesize=256m
nrfiles=1
directory=${DEVICE}
rw=randread
time_based=1
runtime=30s

[sync-d1-s64]
bssplit=4k/1
ioengine=sync
direct=0
group_reporting=1
stonewall
numjobs=4
thread=1

However, when I change the filename_format=data-$jobnum-$filenum.bin to filename_format=data-$filenum.bin (removing $jobnum to share the files), I get the following error from all but one thread:

sync-d1-s64: you need to specify size=
fio: pid=0, err=22/file:filesetup.c:961, func=total_file_size, error=Invalid argument

I also added the size=256m just in case, but the job still fails with the following error:

sync-d1-s64: No I/O performed by sync, perhaps try --debug=io option for details?

debug=all suggests that the error is this:

file     6655  get_next_file: nr_open=0, nr_done=0, nr_files=0
io       6655  io_u 0x7f0a7c001ac0, setting file failed
io       6655  get_io_u failed
sync-d1-s64: No I/O performed by sync, perhaps try --debug=io option for details?

I have tried this on fio v3.8, v3.7, v2.99, and v3.1 (centos yum). As well as different filesystems.

Any thoughts on what I am missing?

sitsofe commented 6 years ago

Wouldn't you be better off using filename? As this isn't so much an issue in fio and more of a "how do I?" question it might be better aimed at the fio mailing list.

xldrx commented 6 years ago

Filename works fine, but I need to use more files hence filename_format.

I find this behavoiur more like a bug.

powernap commented 5 years ago

+1 for treating this as a bug, since the docs would indicate that this is the intended use - it just seems to get tripped up when using numjobs=# to create duplicate jobs when one wishes to test many threads/procs doing the same thing.

Combining numjobs with filename_format would be very nice for more concise and readable workload files.

The following workload files all try to accomplish the same thing, but the last one fails due to this issue. test.txt test2.txt test3.txt

powernap commented 5 years ago

It appears that between fio-3.12 (from Ubuntu packages) and fio-3.14 (built myself) the "No I/O performed by {ioengine}" message no longer appears, which seems like a bigger bug. Without the error message, one would have to actually notice that in the status bar you only get one running thread with the rest in "dead"/_ state.

I see this in both Ubuntu 19.04 and FreeBSD 11.2 when building from the fio-3.14 source tarball.