Forrest logo
back to the fio tool

fio:tldr:ff313

fio: Test random reads.
$ sudo fio --filename=${filename} --direct=1 --rw=randread --bs=4k --ioengine=libaio --iodepth=256 --runtime=120 --numjobs=4 --time_based --group_reporting --name=${job_name} --eta-newline=1 --readonly
try on your machine

This command is using the fio tool with sudo (superuser do) privileges to run a benchmark test on a file.

Let's break down each option and parameter used in the command:

  • --filename=${filename}: Specifies the path and name of the file on which the benchmark test will be performed. The ${filename} is likely a placeholder that needs to be replaced with an actual file name.
  • --direct=1: Enables direct I/O, bypassing the operating system cache, to perform the test.
  • --rw=randread: Specifies that the I/O workload for the test will be random reads.
  • --bs=4k: Sets the block size for each I/O operation to 4 kilobytes.
  • --ioengine=libaio: Selects the I/O engine to be used for the test. In this case, libaio is selected, which is a Linux asynchronous I/O access library.
  • --iodepth=256: Sets the I/O depth to 256, which determines the amount of outstanding I/O operations at a given time.
  • --runtime=120: Sets the duration of the benchmark test to 120 seconds.
  • --numjobs=4: Specifies the number of threads or jobs that will be simultaneously executing I/O operations.
  • --time_based: Indicates that the test will be time-based, meaning the duration (--runtime) defines when the test will end.
  • --group_reporting: Combines the outputs of all jobs into a single report.
  • --name=${job_name}: Specifies a name for the job. The ${job_name} is likely another placeholder that should be replaced.
  • --eta-newline=1: Prints the estimated completion time (ETA) of the test on a new line.
  • --readonly: Restricts the test to only perform read operations, ensuring the data in the file is not modified during the test.

Overall, this command runs a benchmark test on a file using fio with specific settings for random reads, direct I/O, block size, I/O engine, I/O depth, duration, number of jobs, and job name. The sudo command grants the necessary privileges to run the benchmark test.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the fio tool