Skip to content

itcaat/iops-perf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disk Performance Testing Tool

A simple Go-based utility for measuring disk I/O performance. The tool simulates various I/O workloads by reading from and writing to a test file.

Features

  • Supports sequential and random I/O patterns.
  • Configurable test parameters:
    • File size
    • Block size
    • Duration of the test
    • Parallelism (number of threads)
    • I/O mode: read, write, or mixed
    • Write-to-read ratio for mixed mode
  • Outputs key performance metrics:
    • Total operations
    • Total data processed
    • Throughput in MB/s

How It Works

  1. File Setup:

    • A test file of a configurable size is created (default: 1GB).
    • The file is filled with test data to ensure realistic conditions for I/O operations.
  2. Worker Threads:

    • Multiple worker threads operate in parallel, performing I/O operations based on the selected mode and parameters.
    • Each thread performs either:
      • Random I/O: Operations occur at random offsets within the file.
      • Sequential I/O: Operations proceed from the beginning of the file.
  3. Modes of Operation:

    • Write: Threads write data blocks to the file.
    • Read: Threads read data blocks from the file.
    • Mixed: A configurable ratio determines the percentage of write versus read operations.
  4. Metrics Calculation:

    • Total number of operations is counted.
    • Total amount of data processed is calculated.
    • Throughput is reported in MB/s based on the test duration.

Usage

go run . [options]

Options

Flag Default Value Description
--filesize testfile Path to the test file.
--bs 4096 Block size in bytes.
--time 10 Test duration in seconds.
--threads 1 Number of parallel threads.
--mode write Mode of operation: read, write, or mixed.
--write-ratio 50 Write-to-read ratio for mixed mode (0-100).
--random true Use random I/O if true, sequential if false.
--size 1GB Size of the file in bytes.

Example

Run a test with the following parameters:

  • File size: 2GB
  • Block size: 4KB
  • Duration: 15 seconds
  • Parallelism: 4 threads
  • Mixed mode with 70% writes and 30% reads
  • Random I/O enabled
go run . --file testfile --bs 4096 --time 10 --threads 1 --mode write --write-ratio 60 --random --filesize 5G

Sample Output

Test completed:
Total Operations: 512345
Total Data: 2098764800 bytes
Throughput: 133.30 MB/s

Notes

  • The tool ensures the test file is large enough for realistic random access.
  • Ensure adequate disk space is available before running tests.
  • Performance may vary based on disk type, system load, and configuration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages