Created
March 11, 2015 17:54
-
-
Save chorn/6830e60577db804ef40e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iops_simple() { | |
| local _dir="$1" | |
| [[ -d "$_dir" ]] || return | |
| local _output=$(mktemp fio_XXXX) | |
| local _size="2G" | |
| local -i _jobs=8 | |
| local _engine="vsync" | |
| local -i _files=$((_jobs * 4)) | |
| local -i _depth=$((_jobs * 8)) | |
| [[ "${OSTYPE:0:5}" = "linux" ]] && _engine="libaio" | |
| sudo fio \ | |
| --output="$_output" \ | |
| --thread \ | |
| --name="Simple IOPS Test" \ | |
| --directory="$_dir" \ | |
| --readwrite=randrw \ | |
| --ioengine=$_engine \ | |
| --iodepth=$_depth \ | |
| --size=$_size \ | |
| --blocksize=4k \ | |
| --nrfiles=$_files \ | |
| --numjobs=$_jobs \ | |
| --file_service_type=random \ | |
| --direct=1 \ | |
| --overwrite=1 \ | |
| --runtime=300 \ | |
| --unlink=1 \ | |
| --gtod_reduce=1 \ | |
| --minimal | |
| local -i _r=$(cut -f 8 -d ';' "$_output" | tr '\n' '+' | sed -e 's/^/(/' -e 's/\+$/\)/' | bc -q) | |
| local -i _w=$(cut -f 49 -d ';' "$_output" | tr '\n' '+' | sed -e 's/^/(/' -e 's/\+$/\)/' | bc -q) | |
| local _rw=$(( ( _r + _w ) / 2 )) | |
| rm -f "$_output" | |
| echo | |
| echo "[IOPS] READ: $_r WRITE: $_w AVG: $_rw " | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment