Created
August 30, 2018 14:36
-
-
Save xinzweb/03b04974cb4b2233f446d3c257a6c5bf 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
#!/usr/bin/env bash | |
set -x | |
# need to specify where to put the test file (on the target device) | |
if [ $# -eq 0 ] ; then | |
echo "usage: $0 <target file on device>" | |
exit 1 | |
fi | |
# touch a file and see if we can read it | |
TEST_FILE_ON_TARGET_DEVICE=$1 | |
touch ${TEST_FILE_ON_TARGET_DEVICE} | |
if [ $? -ne 0 ] ; then | |
echo "cannot create ${TEST_FILE_ON_TARGET_DEVICE}" | |
exit 1 | |
fi | |
# check throughput in 16 threads MB/sec | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}1 bs=2G count=5 oflag=dsync iflag=fullblock seek=0 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}2 bs=2G count=5 oflag=dsync iflag=fullblock seek=10 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}3 bs=2G count=5 oflag=dsync iflag=fullblock seek=20 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}4 bs=2G count=5 oflag=dsync iflag=fullblock seek=30 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}5 bs=2G count=5 oflag=dsync iflag=fullblock seek=40 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}6 bs=2G count=5 oflag=dsync iflag=fullblock seek=50 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}7 bs=2G count=5 oflag=dsync iflag=fullblock seek=60 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}8 bs=2G count=5 oflag=dsync iflag=fullblock seek=70 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}9 bs=2G count=5 oflag=dsync iflag=fullblock seek=80 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}a bs=2G count=5 oflag=dsync iflag=fullblock seek=90 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}b bs=2G count=5 oflag=dsync iflag=fullblock seek=100 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}c bs=2G count=5 oflag=dsync iflag=fullblock seek=110 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}d bs=2G count=5 oflag=dsync iflag=fullblock seek=120 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}e bs=2G count=5 oflag=dsync iflag=fullblock seek=130 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}f bs=2G count=5 oflag=dsync iflag=fullblock seek=140 & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}0 bs=2G count=5 oflag=dsync iflag=fullblock seek=150 & | |
wait | |
# check latency IO/sec | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}1 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}1 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}2 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}3 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}4 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}5 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}6 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}7 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}8 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}9 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}10 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}11 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}12 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}13 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}14 bs=4096 count=50000 oflag=dsync & | |
dd if=/dev/zero of=${TEST_FILE_ON_TARGET_DEVICE}15 bs=4096 count=50000 oflag=dsync & | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment