save disk test

This commit is contained in:
Jeffrey Paul 2020-02-25 07:10:47 -08:00
parent 1b7944a174
commit 41ceec25dd
3 changed files with 107 additions and 0 deletions

1
fsn1.disktest/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
log.txt

16
fsn1.disktest/Makefile Normal file
View File

@ -0,0 +1,16 @@
HOST := fsn1.datavibe.net
WHEN := $(shell date -u +%Y-%m-%d.%H.%M.%S)
default: runlog
runlog:
script ./log.$(WHEN).txt bash -c "make run"
run: sync
ssh root@$(HOST) "bash /root/disktest.sh"
sync:
rsync -avP ./disktest.sh root@$(HOST):/root/disktest.sh
clean:
rm log.*.txt

90
fsn1.disktest/disktest.sh Normal file
View File

@ -0,0 +1,90 @@
#!/bin/bash
set -x
set -e
date -u
zfs version
killall fio || true
sleep 1
RAWDISKS=$(
cd /dev/disk/by-id ;
ls -1 nvme-SAMSUNG* | grep -v part
)
FULLPATHS=""
for RAWDISK in $RAWDISKS ; do
FULLPATHS+=" /dev/disk/by-id/$RAWDISK"
done
PN="tank"
MPT="/srv/z"
if [[ -e $MPT/.zfs ]]; then
zpool destroy $PN
fi
lsblk -t
for ASHIFTVAL in 12 13 14 15 16 ; do
for DISK in $FULLPATHS ; do
blkdiscard $DISK
nvme format $DISK
done
zpool create $PN \
-o ashift=$ASHIFTVAL -O mountpoint=$MPT \
raidz1 $FULLPATHS
KEYLOC="/tmp/testkey.raw"
dd if=/dev/urandom of=$KEYLOC bs=32 count=1
COMP="-o compression=lz4"
ENC="-o encryption=aes-256-gcm -o keyformat=raw -o keylocation=file://$KEYLOC"
# plain
zfs create $PN/none
# compressed
zfs create $COMP $PN/comp
# encrypted
zfs create $ENC $PN/enc
# compressed and encrypted
zfs create $COMP $ENC $PN/both
FO="--eta-newline=10 --eta-interval=10 --eta=always"
JF="/tmp/jobfile.fio"
rm -f $JF
for NJ in 1 8 32 ; do
for BS in 64k 1M ; do
for DIRNAME in none comp enc both ; do
# 400000M comes from ~1.5x machine's ram size: 256G
cat >> $JF <<EOF
[test-$DIRNAME-${BS}chunk-${NJ}thread]
bs=$BS
directory=$MPT/$DIRNAME/
iodepth=64
ioengine=libaio
readwrite=readwrite
numjobs=$NJ
nrfiles=$NJ
size=$(expr 400000 / $NJ)M
runtime=300
time_based=1
group_reporting=1
EOF
done
done
done
cat $JF
fio $FO $JF
zpool destroy $PN
done