louwrentius / fio-plot

Create charts from FIO storage benchmark tool output
BSD 3-Clause "New" or "Revised" License
370 stars 87 forks source link

bench-fio fails with error: fio: failed parsing size= parameter #92

Closed cmonty14 closed 1 year ago

cmonty14 commented 1 year ago

Hello, I'm trying to execute this command bench-fio --target /mnt/hdd/fio --output CCLOUD_HDD --type file --mode randread,randwrite,randrw --rwmixread 75 --size 10G --block-size 4k,64M --iodepth 1 --numjobs 1 --direct 1 --engine libaio --precondition --runtime 60 --destructive --extra-opts norandommap=1 refill_buffers=1 but it fails with error:

                                                   +++ Fio Benchmark Script +++

Estimated duration            : 0:01:00
Test target                   : /mnt/hdd/fio
Job template                  : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/fio-job-template.fio
I/O Engine                    : libaio
Test mode (read/write)        : randread,randwrite,randrw
IOdepth to be tested          : 1
NumJobs to be tested          : 1
Block size                    : 4k,64M
Direct I/O                    : 1
Specified test data size      : 10G
Run precondition workload     : True
Output folder                 : CCLOUD_HDD
Precondition template         : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio
Time duration per test (s)    : 60
Benchmark loops               : 1
Extra custom options          : norandommap=1 refill_buffers=1
Log interval of perf data (ms): 1000
Invalidate buffer cache       : 1
Allow destructive writes      : True
Target type                   : file
Number of benchmarks          : 1

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
   0% |                         | -   [0:00:00, -:--:--]
An error occurred: fio: failed parsing rw=${MODE}
fio: job iotest dropped -

Can you please advise how to fix this? And I wonder why parameter --rwmixread 75 is not reflected in output.

louwrentius commented 1 year ago

On the command line you need to separate multi-argument parameters with spaces.

bench-fio --target /fio/test.bin --output CCLOUD_HDD --type file --mode randread randwrite randrw --rwmixread 75 --size 1G --block-size 4k 64M --iodepth 1 --numjobs 1 --direct 1 --engine libaio --precondition --runtime 10 --destructive --extra-opts norandommap=1 refill_buffers=1

However, I think there is still an issue with randrw, I have to check

louwrentius commented 1 year ago

This part needs to be cut in default settings.py or I have to be smarter about it.

        else:
            settings["filter_items"].append("rwmixread")
louwrentius commented 1 year ago

I've committed fixes to master branch and also pypi. Let me know if there's still an issue.

cmonty14 commented 1 year ago

Same error returned as in #91

$ bench-fio --target /mnt/manilashare/fio --output CCLOUD_MANILA --type file --mode randread randwrite randrw --rwmixread 75 --size 10G --block-size 4k 64M --iodepth 1 --numjobs 1 --direct 1 --engine libaio --precondition --runtime 60 --destructive --extra-opts norandommap=1 refill_buffers=1
 
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
                                                   +++ Fio Benchmark Script +++

Estimated duration            : 0:06:00
Test target                   : /mnt/manilashare/fio
Job template                  : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/fio-job-template.fio
I/O Engine                    : libaio
Test mode (read/write)        : randread randwrite randrw
IOdepth to be tested          : 1
NumJobs to be tested          : 1
Block size                    : 4k 64M
Direct I/O                    : 1
Specified test data size      : 10G
Run precondition workload     : True
Output folder                 : CCLOUD_MANILA
Precondition template         : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio
Read/write mix in %% read     : 75
Time duration per test (s)    : 60
Benchmark loops               : 1
Extra custom options          : norandommap=1 refill_buffers=1
Log interval of perf data (ms): 1000
Invalidate buffer cache       : 1
Allow destructive writes      : True
Target type                   : file
Number of benchmarks          : 6

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
   0% |                         | -   [0:00:00, -:--:--]
An error occurred: 1m: you need to specify size=
fio: pid=0, err=22/file:filesetup.c:1156, func=total_file_size, error=Invalid argument -
louwrentius commented 1 year ago

Hi, I have taken your command line and altered it just a tad to make it work on my test system.

███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
                                                            +++ Fio Benchmark Script +++

Estimated duration            : 0:01:00
Test target                   : /fio/test.bin
Job template                  : /usr/local/lib/python3.10/dist-packages/fio_plot-1.0.23-py3.10.egg/bench_fio/benchlib/../templates/fio-job-template.fio
I/O Engine                    : libaio
Test mode (read/write)        : randread randwrite randrw
IOdepth to be tested          : 1
NumJobs to be tested          : 1
Block size                    : 4k 64M
Direct I/O                    : 1
Specified test data size      : 1G
Run precondition workload     : True
Output folder                 : CCLOUD_MANILA
Precondition template         : /usr/local/lib/python3.10/dist-packages/fio_plot-1.0.23-py3.10.egg/bench_fio/benchlib/../templates/precondition.fio
Read/write mix in %% read     : 75
Time duration per test (s)    : 10
Benchmark loops               : 1
Extra custom options          : norandommap=1 refill_buffers=1
Log interval of perf data (ms): 1000
Invalidate buffer cache       : 1
Allow destructive writes      : True
Target type                   : file
Number of benchmarks          : 6

███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
 100% |█████████████████████████|   [0:00:37, 0:00:00]-]

Unfortunately I don't see any errors / can't reproduce the issue, are you running the latest version (sorry for stupid question).

cmonty14 commented 1 year ago

I upgraded fio-plot right after your confirmation that fixes are committed to pypi w/o errors:

$ pip3 install --upgrade fio-plot
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fio-plot in ./.local/lib/python3.10/site-packages (1.0.23)
Collecting fio-plot
  Downloading fio-plot-1.0.25.tar.gz (410 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 411.0/411.0 KB 6.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Pillow in ./.local/lib/python3.10/site-packages (from fio-plot) (9.4.0)
Requirement already satisfied: matplotlib in ./.local/lib/python3.10/site-packages (from fio-plot) (3.6.3)
Requirement already satisfied: numpy in ./.local/lib/python3.10/site-packages (from fio-plot) (1.24.1)
Requirement already satisfied: pyan3 in ./.local/lib/python3.10/site-packages (from fio-plot) (1.2.0)
Requirement already satisfied: pyparsing in /usr/lib/python3/dist-packages (from fio-plot) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /usr/lib/python3/dist-packages (from matplotlib->fio-plot) (21.3)
Requirement already satisfied: fonttools>=4.22.0 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (4.38.0)
Requirement already satisfied: python-dateutil>=2.7 in /usr/lib/python3/dist-packages (from matplotlib->fio-plot) (2.8.1)
Requirement already satisfied: contourpy>=1.0.1 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (1.0.7)
Requirement already satisfied: cycler>=0.10 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (0.11.0)
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from pyan3->fio-plot) (3.0.3)
Building wheels for collected packages: fio-plot
  Building wheel for fio-plot (setup.py) ... done
  Created wheel for fio-plot: filename=fio_plot-1.0.25-py3-none-any.whl size=52371 sha256=50b1d266d5b80dca047bf56ab405d647264137e4119b12936adb3a9cc3760289
  Stored in directory: /home/ccloud/.cache/pip/wheels/d6/e7/4d/1c9fc62c4705703c14cf27c944dfdc4e8281459edbeba83c85
Successfully built fio-plot
Installing collected packages: fio-plot
  Attempting uninstall: fio-plot
    Found existing installation: fio-plot 1.0.23
    Uninstalling fio-plot-1.0.23:
      Successfully uninstalled fio-plot-1.0.23
Successfully installed fio-plot-1.0.25

I guess something is missing.

How can I debug bench-fio execution?

louwrentius commented 1 year ago

Strange, you should be at 1.0.26:

image

I just did pip3 install fio-plot and got 1.0.26 on a clean system.

cmonty14 commented 1 year ago

I don't understand why this error occurs although I'm running latest version; this means I can reproduce this error with fio-plot version 1.0.26 on Debian 11 and Ubuntu 22.04.

$ pip3 install --upgrade fio-plot
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fio-plot in ./.local/lib/python3.10/site-packages (1.0.26)
Requirement already satisfied: pyan3 in ./.local/lib/python3.10/site-packages (from fio-plot) (1.2.0)
Requirement already satisfied: matplotlib in ./.local/lib/python3.10/site-packages (from fio-plot) (3.6.3)
Requirement already satisfied: numpy in ./.local/lib/python3.10/site-packages (from fio-plot) (1.24.1)
Requirement already satisfied: Pillow in ./.local/lib/python3.10/site-packages (from fio-plot) (9.4.0)
Requirement already satisfied: pyparsing in /usr/lib/python3/dist-packages (from fio-plot) (2.4.7)
Requirement already satisfied: packaging>=20.0 in /usr/lib/python3/dist-packages (from matplotlib->fio-plot) (21.3)
Requirement already satisfied: fonttools>=4.22.0 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (4.38.0)
Requirement already satisfied: contourpy>=1.0.1 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (1.0.7)
Requirement already satisfied: cycler>=0.10 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (0.11.0)
Requirement already satisfied: python-dateutil>=2.7 in /usr/lib/python3/dist-packages (from matplotlib->fio-plot) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in ./.local/lib/python3.10/site-packages (from matplotlib->fio-plot) (1.4.4)
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from pyan3->fio-plot) (3.0.3)
louwrentius commented 1 year ago

@cmonty14 I saw the same issue when I accidentally ran pip3 install --upgrade fio-plot on that same machine as a non-root user. When I just installed through the system pip3 as root it was fine. Let me know if you resolved the issue.

cmonty14 commented 1 year ago

@cmonty14 I saw the same issue when I accidentally ran pip3 install --upgrade fio-plot on that same machine as a non-root user. When I just installed through the system pip3 as root it was fine. Let me know if you resolved the issue.

Actually I considered this already, means I run this command pip3 install fio-plot for installation a) as non-root user on Ubuntu 22.04 b) as root on Debian 11

For a) all binaries are installed in /home/localuser/.local/bin and for b) in /usr/local/bin.

However the issue is the same for a) and b).

louwrentius commented 1 year ago

Hi, did tou try removing the old version and then installing the latest one?On 2 Feb 2023, at 08:19, Thomas @.***> wrote:

@cmonty14 I saw the same issue when I accidentally ran pip3 install --upgrade fio-plot on that same machine as a non-root user. When I just installed through the system pip3 as root it was fine. Let me know if you resolved the issue.

Actually I considered this already, means I run this command pip3 install fio-plot for installation a) as non-root user on Ubuntu 22.04 b) as root on Debian 11 For a) all binaries are installed in /home//.local/bin and for b) in /usr/local/bin. However the issue is the same for a) and b).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

cmonty14 commented 1 year ago

I reproduced the issue on Debian 10; everything is running as root. Please check attached screenshot for details. 2023-02-02_15-53-47

I can reproduce this error independent of value for parameter mode.

louwrentius commented 1 year ago

Ok, thanks for sharing, I will try and take a look.

louwrentius commented 1 year ago

I've setup a Debian 10 virtual machine to reproduce your issue, installed pip3. Then Installed fio-plot through pip which failed, because some dependencies (pillow) needed some extra libs to be installed in order to build properly. In the end it worked fine and this isn't even about fio-plot but bench-fio anyway.

Then I ran your exact command line except for the actual filename and the output directory. I can't reproduce the issue it seems. Which version of FIO are you using, still. 3.33 build from source from this release?

image

cmonty14 commented 1 year ago

Actually I'm running older versions of fio: Debian 10

# fio --version
fio-3.12

Ubuntu 22.04

~$ fio --version
fio-3.28

Is my understanding of the error message correct that bench-fio is not parsing parameter size to fio? I didn't upgrade (or downgrade) fio since I started deployment of fio-plot; this means fio version was identical when I first used bench-bio and identified issue related to option mode. Therefore I conclude that this issue is not related to fio.

I agree that it's impossible for you to fix this issue as long as it is not reproducible. However I could start debugging bench-fio if you provide relevant instructions.

louwrentius commented 1 year ago

The issue is absolutely with Bench-fio somehow, indeed my main objective is to reproduce the issue so I can fix it. I'll try those fio versions and see if that makes a difference for me.

louwrentius commented 1 year ago

I can't reproduce the issue even with different fio versions.

You can try and edit runfio.py and edit this section:

image

If you can share the cmd line output that could maybe help.

You may also add "print(env)" below the print command line.

louwrentius commented 1 year ago

I'm closing this issue as can't reproduce. Feel free to reopen with relevant output.

cmonty14 commented 1 year ago

Please check the output below after modifying runfio.py: $ bench-fio --target /mnt/manilashare/fio --output CCLOUD_MANILA --type file --size 10G --mode randread randwrite --block-size 4k 64M --iodepth 1 --numjobs 1 --direct 1 --engine libaio --precondition --runtime 60 --destructive --extra-opts norandommap=1 refill_buffers=1

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
                                                   +++ Fio Benchmark Script +++

Estimated duration            : 0:04:00
Test target                   : /mnt/manilashare/fio
Job template                  : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/fio-job-template.fio
I/O Engine                    : libaio
Test mode (read/write)        : randread randwrite
IOdepth to be tested          : 1
NumJobs to be tested          : 1
Block size                    : 4k 64M
Direct I/O                    : 1
Specified test data size      : 10G
Run precondition workload     : True
Output folder                 : CCLOUD_MANILA
Precondition template         : /home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio
Time duration per test (s)    : 60
Benchmark loops               : 1
Extra custom options          : norandommap=1 refill_buffers=1
Log interval of perf data (ms): 1000
Invalidate buffer cache       : 1
Allow destructive writes      : True
Target type                   : file
Number of benchmarks          : 4

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
   0% |                         | -   [0:00:00, -:--:--]['fio', '--output-format=json', '--output=CCLOUD_MANILA/fio/1m/run-1/write-64-1.json', '/home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio', '--size=10G', '--norandommap=1', '--refill_buffers=1', '--filename=/mnt/manilashare/fio']
environ({'SHELL': '/bin/bash', 'HISTCONTROL': 'ignorespace', 'TERM_PROGRAM_VERSION': '3.2a', 'TMUX': '/tmp/tmux-1000/default,4137,0', 'HISTSIZE': '10000', 'PWD': '/home/ccloud', 'LOGNAME': 'ccloud', 'XDG_SESSION_TYPE': 'tty', 'MOTD_SHOWN': 'pam', 'HOME': '/home/ccloud', 'LANG': 'de_DE.UTF-8', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'PROMPT_COMMAND': 'history -a; history -n; history -a; history -n; ', 'SSH_CONNECTION': '10.238.198.131 37002 10.237.81.9 22', 'HSTR_CONFIG': 'hicolor', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'XDG_SESSION_CLASS': 'user', 'TERM': 'screen', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'USER': 'ccloud', 'TMUX_PANE': '%0', 'DISPLAY': 'localhost:10.0', 'SHLVL': '2', 'XDG_SESSION_ID': '4', 'LC_CTYPE': 'en_US', 'XDG_RUNTIME_DIR': '/run/user/1000', 'SSH_CLIENT': '10.238.xxx.xxx 37002 22', 'LC_ALL': 'en_US.UTF-8', 'LC_COLLATE': 'C', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'PATH': '/home/ccloud/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'HISTFILESIZE': '10000', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'SSH_TTY': '/dev/pts/0', 'TERM_PROGRAM': 'tmux', '_': '/home/ccloud/.local/bin/bench-fio', 'TARGET': '/mnt/manilashare/fio', 'TEMPLATE': '/home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio', 'ENGINE': 'libaio', 'MODE': 'write', 'IODEPTH': '64', 'NUMJOBS': '1', 'BLOCK_SIZE': '1m', 'DIRECT': '1', 'SIZE': '10G', 'DRY_RUN': 'False', 'PRECONDITION': 'True', 'QUIET': 'False', 'OUTPUT': 'CCLOUD_MANILA/fio/1m/run-1', 'PRECONDITION_TEMPLATE': '/home/ccloud/.local/lib/python3.10/site-packages/bench_fio/benchlib/../templates/precondition.fio', 'PRECONDITION_REPEAT': 'False', 'ENTIRE_DEVICE': 'True', 'SS': 'False', 'SS_DUR': 'None', 'SS_RAMP': 'None', 'RWMIXREAD': 'None', 'RUNTIME': '60', 'LOOPS': '1', 'TIME_BASED': 'False', 'EXTRA_OPTS': "['norandommap=1', 'refill_buffers=1']", 'LOGINTERVAL': '1000', 'MIXED': "['readwrite', 'rw', 'randrw']", 'INVALIDATE': '1', 'CEPH_POOL': 'None', 'DESTRUCTIVE': 'True', 'LOOP_ITEMS': "['target', 'mode', 'iodepth', 'numjobs', 'block_size']", 'FILTER_ITEMS': "['filter_items', 'loop_items', 'dry_run', 'mixed', 'quiet']", 'TYPE': 'file', 'BENCHMARKS': '4', 'RUN': '1'})

An error occurred: 1m: you need to specify size=
fio: pid=0, err=22/file:filesetup.c:1156, func=total_file_size, error=Invalid argument -

One can see that "size" is missing in +++ Fio Benchmark Script +++ overview.

cmonty14 commented 1 year ago

Please note that I cannot reopen the issue.

louwrentius commented 1 year ago

Thanks for staying with me. I recommend editing your last comment and edit out the IP address info in the environment, not a big deal but maybe it's better.

Specified test data size : 10G

So the size is reported. But by accident I found out how to reproduce the issue.

   0% |                         | -   [0:00:00, -:--:--]Benchmark target file /fio/test.bin does not exist.
root@debian:~# touch /fio/test.bin
root@debian:~# bench-fio --target /fio/test.bin --output CCLOUD_MANILA --type file --size 10G --mode randread randwrite --block-size 4k 64M --iodepth 1 --numjobs 1 --direct 1 --engine libaio --precondition --runtime 60 --destructive --extra-opts norandommap=1 refill_buffers=1
 
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
                                                           +++ Fio Benchmark Script +++

Estimated duration            : 0:04:00
Test target                   : /fio/test.bin
Job template                  : /usr/local/lib/python3.7/dist-packages/fio_plot-1.0.27-py3.7.egg/bench_fio/benchlib/../templates/fio-job-template.fio
I/O Engine                    : libaio
Test mode (read/write)        : randread randwrite
IOdepth to be tested          : 1
NumJobs to be tested          : 1
Block size                    : 4k 64M
Direct I/O                    : 1
Specified test data size      : 10G
Run precondition workload     : True
Output folder                 : CCLOUD_MANILA
Precondition template         : /usr/local/lib/python3.7/dist-packages/fio_plot-1.0.27-py3.7.egg/bench_fio/benchlib/../templates/precondition.fio
Time duration per test (s)    : 60
Benchmark loops               : 1
Extra custom options          : norandommap=1 refill_buffers=1
Log interval of perf data (ms): 1000
Invalidate buffer cache       : 1
Allow destructive writes      : True
Target type                   : file
Number of benchmarks          : 4

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
   0% |                         | -   [0:00:00, -:--:--]
An error occurred: 1m: you need to specify size=
fio: pid=0, err=22/file:filesetup.c:1155, func=total_file_size, error=Invalid argument - 

So the issue you experience occurs if the target file you are trying to benchmark is 0 bytes. If I just issue this command (destructive)

dd if=/dev/zero of=/fio/test.bin bs=1M count=1

And run the benchmark again it works totally fine. So I hope this resolves your issue once and for all ;)

cmonty14 commented 1 year ago

My thanks goes to you for supporting me...

My understanding of your analysis is that bench-fio fails if using a file as test target with size 0 bytes.

Workaround to fix this issue is to create a target file > 0 bytes.

Questions: Why must the target file exist as a prerequisite? Why is fio not creating this target file? And why is the summary in +++ Fio Benchmark Script +++ not showing parameter size and its value?

louwrentius commented 1 year ago

My thanks goes to you for supporting me...

My understanding of your analysis is that bench-fio fails if using a file as test target with size 0 bytes.

Workaround to fix this issue is to create a target file > 0 bytes.

Questions: Why must the target file exist as a prerequisite? Why is fio not creating this target file? And why is the summary in +++ Fio Benchmark Script +++ not showing parameter size and its value?

Hi, happy to help, no worries.

1 & 2: Your questions make sense and I think I've mixed up some concepts. If a file doesn't exist, I just verified that Fio will create the file and start a benchmark. The 0 bytes issue also doesn't happen. So I think I have to fix this issue. 3 - I think the size and value is showing as "Specified test data size : 10G"

The temporary solution should work, or you can decide to just create a directory, in which case fio will create the files and there should be no issues.

cmonty14 commented 1 year ago

Agree... please ignore my question regarding summary in +++ Fio Benchmark Script +++.

If you can provide a fix for the issue related to target file, I would be happy to test it.

louwrentius commented 1 year ago

I've committed a fix to the master branch and actually also released a new pypi version. The fix worked instantly for me.

cmonty14 commented 1 year ago

I have just updated fio-plot to version 1.0.28, however I can reproduce the issue, means target file is not created automatically. And the issue with target file = 0 bytes is not fixed.

cmonty14 commented 1 year ago

Any update on these issues?

louwrentius commented 1 year ago

I've missed your comment, I'll see what I can do - no timelines though.

6meon commented 1 year ago

Hello,

I have same issue with version 1.0.28 (fio 3.25 on Debian 11)

$ bench-fio --target <target> --precondition --type directory --size 100G --mode write --block-size 1M --iodepth=64 --numjobs 8 --engine libaio --direct 1 --runtime 1800 --time-based --output <output> --destructive
An error occurred: fio: time_based requires a runtime/timeout setting
1m: you need to specify size=

For first error fio: time_based requires a runtime/timeout setting, it seems to be linked with --precondition parameter which override --entire-device entry in benchlib/runfio.py, added with issue 84 (commit). If entire_device is set, parameter runtime is ignored (here).

For second one 1m: you need to specify size= it seems to be here with argument --size passed to fio. At least in 3.25 this argument seems to be deprecated... if I replace by --filesize it works but is it the same behaviour than --size before in fio ?

Thanks a lot !

louwrentius commented 1 year ago

@6meon on my test virtual machine I can reproduce the issue. It's the precondition parameter that seems to induce all the issues. If you keep your command line but remove precondition parameter it should work.

The precondition part seems to mess up the variables as you pointed out. I did not have to mess with size/filesize parameters. According to man fio (3.33) size and filesize are valid parameter that each have distinct meaning.

bench-fio --target ~/tmp/fio --type directory --size 1G --mode write --block-size 1M --iodepth=64 --engine sync --numjobs 8 --direct 1 --runtime 1800 --time-based --runtime 60 --output party --destructive

The line above worked for me but preconditioning won't work. I will look at it.

louwrentius commented 1 year ago

@6meon and @cmonty14

The precondition parameter was intended to be used on 'raw' /dev/sdxxx or /dev/nvmexx devices. It was not intended to be used on files or a directory with one or more fio test files. The key problem is that this precondition benchmark expect that a target exists, such as a hard drive or SSD. When using physical devices there is no problem because they exist already. Specifically, the preconditioning job specifies size=100% as the file size.

Both of you try to run a benchmark with --precondtion targeting a non-existing file or an empty directory. If a file doesn't exist, the size=100% parameter makes no sense.

To be frank, I'm not so sure if running the preconditioning benchmark for files or directories is really that useful, does it really have the intended effect? That said, if you really want to run the preconditioning benchmark, you need to create your own custom precondition.fio template based on the included original and change the size=100% parameter to an actual value like size=100G or something.

That said, in the "clientserver" branch of fio-plot I have created an extra parameter --create for bench-fio that will let fio create files if they don't exist yet. I'm not going to port over this feature to the main branch as of yet.

I'm happy to hear your thoughts on this.

6meon commented 1 year ago

Hello @louwrentius

Thanks for your quick reply ! Indeed, it's working without --precondition parameter.

Before reading the code, I was just assuming that precondition parameter is making some magic as it is accepted by the tool with "file" and "directory" modes ; but as you said, preconditioning benchmark is not really accurate if it doesn't consider the whole device. I'm not an expert but maybe it could work by pre-allocating the bench files when using it with file/directory mode ? Like generating and writing "iotest" files first with precondition test, and re-using same files for the real bench ?

For size you're right both parameters size/filesize are valid (and different meanings), I guess command-line argument and precondition job parameter are conflicting if both are set...

Thanks for your help !

louwrentius commented 1 year ago

@6meon Ok I undestand. For now I just advise to test without the precondition parameter. If you really want to explore a worst-case scenario with preconditioning, you have to backup the data from the volume (if any) and target the raw device.

The next best thing is to just keep working with target is file/directory but choose larger file sizes to mimic a filled storage device and see if you notice any performance impact. In this case you don't want to run with time-based but run the benchmark until all sectors are written to and Fio will automatically stop once that goal is achieved.

To be frank, I don't want to "manually" (through bench-fio) pre-allocate files to support the precondition step because I strongly feel that running the precondition workload on files is not the intended use-case and may lead to incorrect results.

louwrentius commented 1 year ago

I'm going to close this one out as 'works as intended'. Let me know if there's any issue, I can always re-open the issue.