diff --git a/fsn1.disktest/.gitignore b/fsn1.disktest/.gitignore new file mode 100644 index 0000000..6bd6746 --- /dev/null +++ b/fsn1.disktest/.gitignore @@ -0,0 +1 @@ +log.txt diff --git a/fsn1.disktest/Makefile b/fsn1.disktest/Makefile new file mode 100644 index 0000000..21cd095 --- /dev/null +++ b/fsn1.disktest/Makefile @@ -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 diff --git a/fsn1.disktest/disktest.sh b/fsn1.disktest/disktest.sh new file mode 100644 index 0000000..f4d4d15 --- /dev/null +++ b/fsn1.disktest/disktest.sh @@ -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 <