Skip to content

A tool to compare filesystem overhead by creating thousands of files and directories using OCaml Domains for multithreaded testing

Notifications You must be signed in to change notification settings

mtelvers/fsperf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fsperf

A multithreaded filesystem performance testing tool written in OCaml that compares filesystem overhead by creating thousands of files and directories using OCaml Domains.

Features

  • 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

Requirements

  • 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)

Installation

# Install dependencies
opam install cmdliner mtime unix

# Build the project
dune build

# Install locally (optional)
dune install

Usage

# 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

Options

  • --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

Architecture

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.

Example Output

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

Development

# Run tests
dune test

# Watch mode during development
dune build --watch

# Clean build artifacts
dune clean

License

See project license file.

About

A tool to compare filesystem overhead by creating thousands of files and directories using OCaml Domains for multithreaded testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published