-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a first fio test "sequental_read"
The snapshot image is a virtual block device. I/O units to the image are redirected to the original device. Therefore, the reading performance from the snapshot image should be slightly lower than from the original block device. It is important to know what the difference is. The test allows to measure this difference.
- Loading branch information
1 parent
3bd8de9
commit eefb2a8
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[global] | ||
kb_base=1024 | ||
directory=${DIR} | ||
; filename_format=jobname.jobnumber.filenumber | ||
direct=1 | ||
iodepth=8 | ||
|
||
[sequental_read] | ||
ioengine=libaio | ||
rw=read | ||
bs=1m | ||
size=512m | ||
|
||
[sequental_read_4k] | ||
ioengine=libaio | ||
rw=read | ||
bs=4k | ||
size=32m |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash -e | ||
# | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
|
||
. ./functions.sh | ||
. ./blksnap.sh | ||
|
||
echo "---" | ||
echo "FIO sequental read test" | ||
|
||
fio --version | ||
blksnap_load | ||
blksnap_version | ||
|
||
if [ -z $1 ] | ||
then | ||
TEST_DIR=${HOME}/blksnap-test | ||
else | ||
TEST_DIR=$(realpath $1"/blksnap-test") | ||
fi | ||
mkdir -p ${TEST_DIR} | ||
rm -rf ${TEST_DIR}/* | ||
|
||
MP_TEST_DIR=$(stat -c %m ${TEST_DIR}) | ||
DEVICE="/dev/block/"$(mountpoint -d ${MP_TEST_DIR}) | ||
echo "Test directory [${TEST_DIR}] on device [${DEVICE}] selected" | ||
|
||
MP_DIR=/mnt/blksnap-test | ||
rm -rf ${MP_DIR} | ||
mkdir -p ${MP_DIR} | ||
|
||
DIR=${MP_TEST_DIR} fio --section sequental_read ./blksnap.fio | ||
|
||
blksnap_snapshot_create "${DEVICE}" "/dev/shm" "1G" | ||
blksnap_snapshot_watcher | ||
blksnap_snapshot_take | ||
|
||
|
||
IMAGE=${MP_DIR}/image0 | ||
mkdir -p ${IMAGE} | ||
|
||
echo "Mount image" | ||
DEVICE_IMAGE=$(blksnap_get_image ${DEVICE}) | ||
mount ${DEVICE_IMAGE} ${IMAGE} | ||
|
||
DIR="${IMAGE}/${MP_TEST_DIR}" fio --section sequental_read ./blksnap.fio | ||
|
||
echo "Umount image" | ||
umount ${IMAGE} | ||
|
||
echo "Destroy snapshot" | ||
blksnap_snapshot_destroy | ||
blksnap_detach ${DEVICE} | ||
blksnap_watcher_wait | ||
|
||
blksnap_unload | ||
|
||
echo "FIO sequental read test finish" | ||
echo "---" |
eefb2a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeiShtepa as reported by codacy ( https://app.codacy.com/gh/Fantu/blksnap/issues/current?levels=Warning&categories=CodeStyle ) there are many variables used without double quote to prevent globbing and word splitting
without fixing them all right, which could take a long time, but could you quote them correctly in new scripts or ones you will modify please?
eefb2a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this can be a problem if there are spaces in the names of directories and files.
I won't think about it yet.