A multithreaded filesystem performance testing tool written in OCaml that compares filesystem overhead by creating thousands of files and directories using OCaml Domains.
- Multiple Filesystem Support: XFS, EXT4, ZFS, and BTRFS through pluggable backends
- Multithreaded Performance: Uses OCaml 5.x Domains for concurrent I/O operations
- Comprehensive Testing: Various workload types including random files, deep directories, many small files, and large files
- Safety Features: Device validation, mounted filesystem detection, and automatic cleanup
- CSV Export: Results can be exported for analysis and comparison
- OCaml 5.2.1+
- Dune 3.19.1+
- Filesystem utilities:
- XFS:
xfsprogs
(mkfs.xfs
,xfs_admin
) - EXT4:
e2fsprogs
(mkfs.ext4
,tune2fs
) - BTRFS:
btrfs-progs
(mkfs.btrfs
,btrfs
) - ZFS:
zfsutils-linux
(zpool
,zfs
)
- XFS:
# Install dependencies
opam install cmdliner mtime unix
# Build the project
dune build
# Install locally (optional)
dune install
# Basic usage
dune exec -- fsperf /dev/sdc xfs
# With custom parameters
dune exec -- fsperf /dev/sdc xfs --files 1000 --domains 4 --force-unmount --output results.csv
# Compare filesystems (run separately)
dune exec -- fsperf /dev/sdc xfs --output xfs_results.csv
dune exec -- fsperf /dev/sdc ext4 --output ext4_results.csv
--files N
: Number of files to create (default varies by workload)--domains N
: Number of concurrent domains/threads--force-unmount
: Automatically unmount if device is mounted--output FILE
: Export results to CSV file--help
: Show detailed help
Pluggable Backends: Uses OCaml functors to provide a clean interface for different filesystems, making it easy to add support for new filesystem types.
Multithreaded Execution: Leverages OCaml 5.x Domains to distribute file creation across multiple threads for realistic performance testing.
Safety First: Validates block devices, checks for existing mounts, and provides user confirmation for destructive operations.
Filesystem: XFS on /dev/sdc
Files created: 1000
Directories created: 100
Total time: 2.34s
Files/sec: 427.35
Directories/sec: 42.74
Total ops/sec: 470.09
# Run tests
dune test
# Watch mode during development
dune build --watch
# Clean build artifacts
dune clean
See project license file.