No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hendrik 'Sharky' Schumann 3c825f1eb0
whoops
10 months ago
.gitignore working buffered 2 years ago
CMakeLists.txt arbitrary-length iopings :3 (up to 2^30 bytes) 10 months ago
LICENSE Initial commit 2 years ago
README.md typo 2 years ago
common.c arbitrary-length iopings :3 (up to 2^30 bytes) 10 months ago
common.h arbitrary-length iopings :3 (up to 2^30 bytes) 10 months ago
ioping-munin.c arbitrary-length iopings :3 (up to 2^30 bytes) 10 months ago
ioping.c whoops 10 months ago
random_bytes.c Cleanup Split up code between ioping (ping-like tool) and ioping-munin (munin plugin like before) 10 months ago
random_bytes.h Cleanup Split up code between ioping (ping-like tool) and ioping-munin (munin plugin like before) 10 months ago

README.md

naive-IOping

This is a simple tool (and munin plugin) to measure HDD latency with high accuracy.

Features:

  • Direct I/O to bypass any caching (only on Linux (?))
  • clock_gettime(CLOCK_MONOTONIC, …) for nano-second accuracy (depending on platform)
  • munin compatible output
  • no external dependencies

How it works:

Pretty simple stuff:

  • The tool sets up and aligns a hardcoded 1MB buffer
  • measures the current timestamp as described by clock_gettime(CLOCK_MONOTONIC, ...)
    • creates & opens a file for direct I/O
    • writes the buffer & closes the file
  • creates a second timestamp and displays the difference between the two (the elapsed time)

Configuring:

ioping.c offers minimal configuration using the #define’s at the beginning of the file.

#define NUM_IOPING_RUNS 3 // number of times ioping writes to disk, results will be averaged
#define SLEEP_BETWEEN_RUNS 1 // in seconds
#define PING_PATH "/var/tmp/test.ping" // file path to write to

Using /tmp for PING_PATH is discouraged since some servers mount a ramdisk/tmpfs on that path.

Compiling:

I personally use CMake but you are free to use your own build system or directly invoke gcc:

mkdir build
cmake ..
make
# run with:
./ioping

Munin support:

Simply drop the binary in your plugins directory and restart munin-node:

cp -v ioping /etc/munin/plugins/
systemctl restart munin-node

Tips:

  • Bitcoin: 1CPqeySrvHxxejok9iY4caYHCMaUxr9VEQ