axboe / fio

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

startdelay not working #1164

Open thaotran9 opened 3 years ago

thaotran9 commented 3 years ago

I have noticed that a job did not delay the starting time when using startdelay option. I wonder if I missed anything or this is a bug.

Here is my fio file:

[global] filename=C\:\test_file cpus_allowed=0-2 cpumask=7 direct=1 time_based=1 runtime=30 thread=1

[test] stonewall rw=randrw blockalign=512B rwmixread=80 rwmixwrite=20 percentage_random=50 bssplit=4k/15:8k/20:16k/20:32k/15:64k/15:128k/10:256k/5

[test] stonewall startdelay=30 rw=randrw blockalign=512B rwmixread=80 rwmixwrite=20 percentage_random=50 bssplit=4k/15:8k/20:16k/20:32k/15:64k/15:128k/10:256k/5

sitsofe commented 3 years ago

@thaotran9 Hello!

We can only look into an issue when we have all the information requested in https://github.com/axboe/fio/blob/master/.github/SUPPORT.md#reporting-bugs / https://github.com/axboe/fio/blob/master/REPORTING-BUGS#L12 . Could you edit all this information into your comment above? Thank you!

thaotran9 commented 3 years ago

Issue: I observed that startdelay option did not delay the starting time of a job.

FIO version: 3.25 on Windows 10

Reproduction steps and minimal job file/command line parameters:

thaotran9 commented 3 years ago

I see my issue, startdelay delays the starting time of a job from the beginning not from the previous job. Does it make more sense to delay from previous job though?

sitsofe commented 3 years ago

@thaotran9:

startdelay delays the starting time of a job from the beginning

Yes, it looks like that's the case. See the following:

Does it make more sense to delay from previous job though?

While I don't think it makes sense to redefine the existing option it could be done as a new parameter (per_job_start_delay?) that starts its timer from after all stonewall/waits have expired. You would have to store a per thread "start" time somewhere... One idea would be to create an array for each job. You would then check if per_job_start_delay is on for this particular job and if so then when we get to https://github.com/axboe/fio/blob/fio-3.25/backend.c#L2331 we can store a "start" time into the array and check if the delay time has expired if it was previously set on future iterations.

Whichever approach is taken, this is a new feature request so I'll label it up as such. Please be aware that most new feature requests are only completed through the work of new contributors (the fio developers are busy with non-fio work). Would you like to take an attempt to code this up so we can review it?

thaotran9 commented 3 years ago

What you described is great for the new parameter. There is a workaround when previous job's runtime is specified, we can keep track of how many seconds the workload has passed but when io_size is used instead of runtime, we don't have a way to know in advance which value to use for startdelay.