simple-disk-benchmark

A simple disk benchmark tool.

Alt text

Operating Systems

Currently, macOS and Linux are tested. Windows may work but is not tested. Development is on macOS.

Installation

sh cargo install simple-disk-benchmark

Usage

```sh A simple tool for benchmarking disk performance

Usage: simple-disk-benchmark [OPTIONS] [FILE]

Arguments: [FILE] File to use for benchmarking. If this file exists it will be deleted [default: testfile.dat]

Options: -s, --size Size of the file to use for benchmarking [default: 1GB] -b, --blocksize Size of the blocks to read/write [default: 128MB] -c, --cycles Number of test cycles to run [default: 10] -m, --mode Types of test to run: read, write or all [default: all] -v, --verbose... More output per occurrence -q, --quiet... Less output per occurrence -h, --help Print help -V, --version Print version ```

Methodology

Specify the path to a file to use for benchmarking. If the file exists, it will be deleted. You can specify paths on other drives by using the full path to the file (e.g. /Volumes/MyDrive/testfile.dat).

The benchmark tool will create a file of the specified size and then run the specified number of cycles. Each cycle will read or write the multiple blocks of a specified size to the file.

On macOS, the file is opened and FNOCACHE and FGLOBALNOCACHE are both set on the file descriptor. This will bypass the file system cache and write directly to the disk. On Linux, the O_DIRECT flag is used to achieve the same result.

TODO

License

MIT License. See LICENSE file.