e7db/diskmark

By e7db

Updated 5 months ago

A fio-based docker container to benchmark your disks, similar to what CrystalDiskMark does.

Image
Databases & storage
1

10K+

e7db/diskmark repository overview

docker-diskmark

GitHub tag codeql tests docker-image

A fio-based disk benchmark docker container, similar to what CrystalDiskMark does.

Basic Usage

# From Docker Hub
docker pull e7db/diskmark
docker run -it --rm e7db/diskmark

# From GitHub Container Registry
docker pull ghcr.io/e7db/diskmark
docker run -it --rm ghcr.io/e7db/diskmark

Docker DiskMark

Options

All options can be configured via CLI arguments (recommended) or environment variables. CLI arguments take precedence.

The container supports multiple CLI formats: --key value, --key=value, and -k value.

ShortLongEnv VarDefaultDescription
-h--helpShow help message and exit
-v--versionShow version information and exit
-t--targetTARGET/diskTarget directory for benchmark
-p--profilePROFILEautoBenchmark profile: auto, default, nvme
-j--jobJOBCustom job definition (e.g., RND4KQ32T16). Overrides profile.
-i--ioIOdirectI/O mode: direct (sync), buffered (async)
-d--dataDATArandomData pattern: random, zero
-s--sizeSIZE1GTest file size (e.g., 500M, 1G, 10G)
-w--warmupWARMUP=11Enable warmup phase
--no-warmupWARMUP=0Disable warmup phase
--warmup-sizeWARMUP_SIZE(profile)Warmup block size (8M default, 64M nvme)
-r--runtimeRUNTIME5sRuntime per job (e.g., 500ms, 5s, 2m)
-l--loopsLOOPSNumber of test loops
-n--dry-runDRY_RUN=10Validate configuration without running
-f--formatFORMATOutput format: json, yaml, xml
-u--no-update-checkUPDATE_CHECK=01Disable update check at startup
--colorCOLOR=1Force colored output
--no-colorCOLOR=0Disable colored output
--emojiEMOJI=1Force emoji output
--no-emojiEMOJI=0Disable emoji output

Profiles

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

Examples

Basic parameters
# 4 GB file, 2 loops, warmup, zero data pattern
docker run -it --rm e7db/diskmark --size 4G --warmup --loops 2 --data zero
docker run -it --rm e7db/diskmark -s 4G -w -l 2 -d zero

# Hybrid mode: 3 loops, each capped at 10 seconds
docker run -it --rm e7db/diskmark --loops 3 --runtime 10s

# Custom warmup block size
docker run -it --rm e7db/diskmark --warmup --warmup-size 128M
Force profile

Drive detection selects the appropriate profile (default or nvme). Override if needed:

docker run -it --rm e7db/diskmark --profile nvme
Custom job

Run a custom job using the format [RND|SEQ][size][Q depth][T threads]:

  • RND or SEQ — random or sequential access
  • xxK or xxM — block size (e.g., 4K, 1M)
  • Qyy — queue depth
  • Tzz — number of threads

Example: RND4KQ32T16 = random 4K blocks, queue depth 32, 16 threads.

docker run -it --rm e7db/diskmark --job RND4KQ32T16
Specific disk

By default, the benchmark uses a Docker volume at /disk. Mount a different path to benchmark another disk:

docker run -it --rm -v /path/to/disk:/disk e7db/diskmark
Machine-readable output

Output in JSON, YAML, or XML for scripting (automatically disables colors, emojis, and update check):

docker run -it --rm e7db/diskmark --format json
docker run -it --rm e7db/diskmark --format yaml
docker run -it --rm e7db/diskmark --format xml
JSON output sample
{
  "configuration": {
    "target": "/mnt",
    "drive": {
      "label": "NVMe",
      "info": "Samsung SSD 990 PRO 2TB"
    },
    "filesystem": {
      "type": "ext4",
      "partition": "/dev/nvme0n1p1",
      "size": "1.8T"
    },
    "profile": "nvme",
    "io": "direct",
    "data": "random",
    "size": "1G",
    "warmup": 1,
    "runtime": "5s"
  },
  "results": [
    {"name": "SEQ1MQ8T1", "status": "success", "read": {"bandwidth_mb": 524, "iops": 499, "latency_ms": 2.15}, "write": {"bandwidth_mb": 498, "iops": 475, "latency_ms": 1.89}},
    {"name": "SEQ1MQ1T1", "status": "success", "read": {"bandwidth_mb": 512, "iops": 488, "latency_ms": 0.52}, "write": {"bandwidth_mb": 487, "iops": 464, "latency_ms": 0.48}},
    {"name": "RND4KQ32T1", "status": "success", "read": {"bandwidth_mb": 45, "iops": 11691, "latency_ms": 2.73}, "write": {"bandwidth_mb": 42, "iops": 10839, "latency_ms": 2.95}},
    {"name": "RND4KQ1T1", "status": "success", "read": {"bandwidth_mb": 41, "iops": 10583, "latency_ms": 0.09}, "write": {"bandwidth_mb": 38, "iops": 9814, "latency_ms": 0.10}}
  ]
}
YAML output sample
configuration:
  target: "/mnt"
  drive:
    label: "NVMe"
    info: "Samsung SSD 990 PRO 2TB"
  filesystem:
    type: "ext4"
    partition: "/dev/nvme0n1p1"
    size: "1.8T"
  profile: "nvme"
  io: "direct"
  data: "random"
  size: "1G"
  warmup: 1
  runtime: "5s"
results:
  - name: "SEQ1MQ8T1"
    status: "success"
    read:
      bandwidth_mb: 524
      iops: 499
      latency_ms: 2.15
    write:
      bandwidth_mb: 498
      iops: 475
      latency_ms: 1.89
  - name: "SEQ1MQ1T1"
    status: "success"
    read:
      bandwidth_mb: 512
      iops: 488
      latency_ms: 0.52
    write:
      bandwidth_mb: 487
      iops: 464
      latency_ms: 0.48
  - name: "RND4KQ32T1"
    status: "success"
    read:
      bandwidth_mb: 45
      iops: 11691
      latency_ms: 2.73
    write:
      bandwidth_mb: 42
      iops: 10839
      latency_ms: 2.95
  - name: "RND4KQ1T1"
    status: "success"
    read:
      bandwidth_mb: 41
      iops: 10583
      latency_ms: 0.09
    write:
      bandwidth_mb: 38
      iops: 9814
      latency_ms: 0.10
XML output sample
<?xml version="1.0" encoding="UTF-8"?>
<benchmark>
  <configuration>
    <target>/mnt</target>
    <drive label="NVMe">Samsung SSD 990 PRO 2TB</drive>
    <filesystem type="ext4" partition="/dev/nvme0n1p1" size="1.8T" />
    <profile>nvme</profile>
    <io>direct</io>
    <data>random</data>
    <size>1G</size>
    <warmup>1</warmup>
    <runtime>5s</runtime>
  </configuration>
  <results>
    <job name="SEQ1MQ8T1" status="success">
      <read bandwidth_mb="524" iops="499" latency_ms="2.15" />
      <write bandwidth_mb="498" iops="475" latency_ms="1.89" />
    </job>
    <job name="SEQ1MQ1T1" status="success">
      <read bandwidth_mb="512" iops="488" latency_ms="0.52" />
      <write bandwidth_mb="487" iops="464" latency_ms="0.48" />
    </job>
    <job name="RND4KQ32T1" status="success">
      <read bandwidth_mb="45" iops="11691" latency_ms="2.73" />
      <write bandwidth_mb="42" iops="10839" latency_ms="2.95" />
    </job>
    <job name="RND4KQ1T1" status="success">
      <read bandwidth_mb="41" iops="10583" latency_ms="0.09" />
      <write bandwidth_mb="38" iops="9814" latency_ms="0.10" />
    </job>
  </results>
</benchmark>

Tag summary

Content type

Image

Digest

sha256:dd7ce4a3a

Size

16.2 MB

Last updated

5 months ago

docker pull e7db/diskmark