A fio-based disk benchmark docker container, similar to what CrystalDiskMark does.
docker pull e7db/diskmark
docker run -it --rm e7db/diskmark
The container contains two different test profiles:
- Default profile:
- Sequential 1M Q8T1
- Sequential 1M Q1T1
- Random 4K Q32T1
- Random 4K Q1T1
- NVMe profile:
- Sequential 1M Q8T1
- Sequential 128K Q32T1
- Random 4K Q32T16
- Random 4K Q1T1
Find below a table listing all the different parameters you can use with the container:
| Parameter | Type | Default | Description |
|---|---|---|---|
PROFILE |
Environment | auto |
The profile to apply: - auto to try and autoselect the best one based on the used drive detection,- default, best suited for hard disk drives,- nvme, best suited for NVMe SSD drives. |
JOB |
Environment | A custom job to use: details below in the Custom job section. This parameter overrides the PROFILE parameter. |
|
IO |
Environment | direct |
The drive access mode: - direct for synchronous I/O,- buffered for asynchronous I/O. |
DATA |
Environment | random |
The test data: - random to use random data,- 0x00 to fill with 0 (zero) values. |
SIZE |
Environment | 1G |
The size of the test file (e.g., 500M, 1G, 10G). |
WARMUP |
Environment | 0 |
When set to 1, use a warmup phase, thus preparing the test file with dd, using either random data or zero values as set by DATA. |
WARMUP_SIZE |
Environment | Warmup block size. Defaults depend on the profile: - 8M for the default profile- 64M for the NVMe profile. |
|
RUNTIME |
Environment | 5s |
The duration for each job (e.g., 1s, 5s, 2m).Used alone: time-based benchmark. Used with LOOPS: caps each loop to this duration. |
LOOPS |
Environment | The number of test loops to run. Used alone: runs exactly N loops with no time limit. Used with RUNTIME: runs N loops, each capped to RUNTIME. |
|
DRY_RUN |
Environment | 0 |
When set to 1, validates configuration without running the benchmark. |
/disk |
Volume | The target path to benchmark. |
By default, a 1 GB test file is used, with a 5 seconds duration for each test, reading and writing random bytes on the disk where Docker is installed.
For example, you can use a 4 GB file, looping each test twice, but after a warmup phase, and writting only zeros instead of random data.
You can achieve this using the following command:
docker run -it --rm -e SIZE=4G -e WARMUP=1 -e LOOPS=2 -e DATA=0x00 e7db/diskmark
You can also combine LOOPS and RUNTIME for hybrid mode — run a fixed number of loops, but cap each loop's duration:
docker run -it --rm -e SIZE=1G -e LOOPS=3 -e RUNTIME=10s e7db/diskmark
Warmup block size is tunable with WARMUP_SIZE (e.g. 8M, 64M, 128M). By default it adapts to the selected profile: 8M for the default profile (HDD-friendly) and 64M for the NVMe profile. You can override it explicitly if needed:
docker run -it --rm -e WARMUP=1 -e WARMUP_SIZE=128M e7db/diskmark
A detection of your disk is tried, so the benchmark uses the appropriate profile, default or nvme.
In the event that the detection fails, yielding "Unknown", or returns the wrong profile, you can force the use of either of the profiles:
docker run -it --rm -e PROFILE=nvme e7db/diskmark
You can run a custom single job using the JOB parameter.
The job expression must follow a specific format, such as follows: RND4KQ32T16.
It is composed of 4 parts:
RNDorSEQ, for random or sequential accessxxKorxxM, wherexxis the block size, andKorMis the unit (Kilobytes or Megabytes)Qyy, whereyyis the queue depthTzz, wherezzis the number of threads
In the previous example RND4KQ32T16, the job uses random accesses, with a block size of 4K, a queue depth of 32, and 16 threads.
Construct your custom chain, then run the benchmark using the following command:
docker run -it --rm -e JOB=RND4KQ32T16 e7db/diskmark
By default, the benchmark runs on the disk where Docker is installed, using a Docker volume mounted on the /disk path inside the container.
To run the benchmark on a different disk, use a path belonging to that disk, and mount it as the /disk volume:
docker run -it --rm -v /path/to/specific/disk:/disk e7db/diskmark
