hacks as of 9 mar

This commit is contained in:
Jeffrey Paul 2020-03-09 08:20:42 -07:00
parent 41ceec25dd
commit c24e396a5d
8 changed files with 951 additions and 47 deletions

View File

@ -0,0 +1,43 @@
#!/bin/bash
# thanks to @sebble for the basis for this script, he did the hard work:
# https://gist.github.com/sebble/e5af3d03700bfd31c62054488bfe8d4f
function list_starred_repos {
USER=${1:-sneak}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories. > /dev/stderr
# cloning
# https://github.com/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
# breaks github's auth system
REPOS=""
for PAGE in `seq $PAGES`; do
REPOS+=" $(
curl -sH "Accept: application/vnd.github.v3.star+json" "https://api.github.com/users/$USER/starred?per_page=100&page=$PAGE" |
jq -r '.[]|[.repo.full_name][0]' |
grep -v eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
)"
done
for REPO in $REPOS ; do
echo "$REPO"
done
}
function fetch_starred_repos {
for SHORTNAME in $(list_starred_repos); do
UN="$(echo $SHORTNAME | cut -d'/' -f1)"
if [[ ! -d "$SHORTNAME" ]]; then
if [[ ! -d "$UN" ]]; then
mkdir -p $UN
fi
git clone https://github.com/$SHORTNAME $SHORTNAME
fi
done
}
fetch_starred_repos

View File

@ -1 +1 @@
log.txt *.txt

View File

@ -7,10 +7,13 @@ runlog:
script ./log.$(WHEN).txt bash -c "make run" script ./log.$(WHEN).txt bash -c "make run"
run: sync run: sync
ssh root@$(HOST) "bash /root/disktest.sh" ssh root@$(HOST) "bash /root/disktest.sh 2>&1"
sync: sync:
rsync -avP ./disktest.sh root@$(HOST):/root/disktest.sh rsync -avP ./disktest.sh root@$(HOST):/root/disktest.sh
clean: clean:
rm log.*.txt rm log.*.txt
results:
grep -ie 'cpu\|encryption\|zfs\|ashift\|64kchunk\|read\|write\|samsung' *.txt | grep -v groupid | grep -v '^readwrite' | grep -v echo | grep -v rm | grep -v Laying

View File

@ -1,12 +1,6 @@
#!/bin/bash #!/bin/bash
set -x set -x
set -e
date -u
zfs version
killall fio || true
sleep 1
RAWDISKS=$( RAWDISKS=$(
cd /dev/disk/by-id ; cd /dev/disk/by-id ;
@ -18,54 +12,124 @@ for RAWDISK in $RAWDISKS ; do
FULLPATHS+=" /dev/disk/by-id/$RAWDISK" FULLPATHS+=" /dev/disk/by-id/$RAWDISK"
done done
PN="tank" POOLNAME="tank"
MPT="/srv/z" MPT="/srv/z"
JOBFILE="/tmp/jobfile.fio"
KEYLOC="/tmp/testkey.raw"
if [[ -e $MPT/.zfs ]]; then function main() {
zpool destroy $PN show_system_info
fi prep_system
do_direct_tests
do_zfs_tests
}
lsblk -t function do_direct_tests() {
trim_disks
for DISK in $FULLPATHS; do
print_divider
echo "testing $DISK"
for NJ in 1 16; do
for BS in 64k ; do
cat > $JOBFILE <<EOF
[test-${BS}chunk-${NJ}thread]
bs=$BS
filename=$DISK
iodepth=64
ioengine=libaio
readwrite=readwrite
numjobs=$NJ
size=$(expr 10000 / $NJ)M
runtime=60
time_based=1
group_reporting=1
EOF
cat $JOBFILE
fio $FO $JOBFILE 2>&1
done
done
done
}
for ASHIFTVAL in 12 13 14 15 16 ; do function print_divider() {
echo '##############################################################'
echo '##############################################################'
}
function trim_disks() {
for DISK in $FULLPATHS ; do for DISK in $FULLPATHS ; do
blkdiscard $DISK blkdiscard $DISK
nvme format $DISK nvme format -r $DISK
done done
print_divider
echo "################## waiting 60s for nvme format to complete..."
sleep 60
nvme list
}
zpool create $PN \
-o ashift=$ASHIFTVAL -O mountpoint=$MPT \
raidz1 $FULLPATHS
KEYLOC="/tmp/testkey.raw" function show_system_info() {
dd if=/dev/urandom of=$KEYLOC bs=32 count=1 print_divider
date -u
lsb_release -a
uname -a
lsblk -t
nvme list
modinfo zfs | grep -iw version
modinfo spl | grep -iw version
zfs version
print_divider
}
COMP="-o compression=lz4" function prep_system() {
ENC="-o encryption=aes-256-gcm -o keyformat=raw -o keylocation=file://$KEYLOC" killall fio || true
sleep 1
# plain if [[ -e $MPT/.zfs ]]; then
zfs create $PN/none zpool destroy $POOLNAME
# compressed fi
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" function do_zfs_tests() {
for ASHIFTVAL in 12 13 14 15 16 ; do
JF="/tmp/jobfile.fio" trim_disks
rm -f $JF
for NJ in 1 8 32 ; do print_divider
for BS in 64k 1M ; do
for DIRNAME in none comp enc both ; do
# 400000M comes from ~1.5x machine's ram size: 256G zpool create $POOLNAME \
cat >> $JF <<EOF -o ashift=$ASHIFTVAL -O mountpoint=$MPT \
raidz1 $FULLPATHS
[test-$DIRNAME-${BS}chunk-${NJ}thread] 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 $POOLNAME/none
# compressed
zfs create $COMP $POOLNAME/comp
# encrypted
zfs create $ENC $POOLNAME/enc
# compressed and encrypted
zfs create $COMP $ENC $POOLNAME/both
FO="--eta-newline=10 --eta-interval=10 --eta=always"
for NJ in 1 16 ; do
for BS in 64k ; do
for DIRNAME in none comp enc both ; do
cat > $JOBFILE <<EOF
[test-$DIRNAME-${BS}chunk-${NJ}thread-ashift${ASHIFTVAL}]
bs=$BS bs=$BS
directory=$MPT/$DIRNAME/ directory=$MPT/$DIRNAME/
iodepth=64 iodepth=64
@ -73,18 +137,20 @@ ioengine=libaio
readwrite=readwrite readwrite=readwrite
numjobs=$NJ numjobs=$NJ
nrfiles=$NJ nrfiles=$NJ
size=$(expr 400000 / $NJ)M size=10000M
runtime=300 runtime=120
time_based=1 time_based=1
group_reporting=1 group_reporting=1
EOF EOF
cat $JOBFILE
fio $FO $JOBFILE 2>&1
rm -rf $MPT/$DIRNAME/*
done
done done
done done
zpool destroy $POOLNAME
done done
}
cat $JF main
fio $FO $JF
zpool destroy $PN
done

19
nbg1.disktest/Makefile Normal file
View File

@ -0,0 +1,19 @@
HOST := nbg1.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 2>&1"
sync:
rsync -avP ./disktest.sh root@$(HOST):/root/disktest.sh
clean:
rm log.*.txt
results:
grep -ie 'cpu\|encryption\|zfs\|ashift\|64kchunk\|read\|write\|samsung' *.txt | grep -v groupid | grep -v '^readwrite' | grep -v echo | grep -v rm | grep -v Laying

72
nbg1.disktest/disktest.sh Normal file
View File

@ -0,0 +1,72 @@
#!/bin/bash
set -x
POOLNAME="tank"
MPT="/srv/z"
JOBFILE="/tmp/jobfile.fio"
KEYLOC="/tmp/testkey.raw"
function main() {
show_system_info
do_zfs_tests
}
function print_divider() {
echo '##############################################################'
echo '##############################################################'
}
function show_system_info() {
print_divider
date -u
lsb_release -a
uname -a
lsblk -t
nvme list
modinfo zfs | grep -iw version
modinfo spl | grep -iw version
zfs version
print_divider
}
function prep_system() {
killall fio || true
sleep 1
}
function do_zfs_tests() {
print_divider
FO="--eta-newline=10 --eta-interval=10 --eta=always"
for NJ in 1 16 ; do
for BS in 64k ; do
for DIRNAME in none comp enc both ; do
cat > $JOBFILE <<EOF
[test-$DIRNAME-${BS}chunk-${NJ}thread]
bs=$BS
directory=$MPT/$DIRNAME/
iodepth=64
ioengine=libaio
readwrite=readwrite
numjobs=$NJ
nrfiles=$NJ
size=10000M
runtime=120
time_based=1
group_reporting=1
EOF
cat $JOBFILE
fio $FO $JOBFILE 2>&1
rm -rf $MPT/$DIRNAME/*
done
done
done
}
main

View File

@ -0,0 +1,9 @@
Script started on Fri Feb 28 13:46:16 2020
command: bash -c make run
rsync -avP ./disktest.sh root@nbg1.datavibe.net:/root/disktest.sh
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.3]
make[1]: *** [sync] Error 127
Script done on Fri Feb 28 13:46:16 2020

File diff suppressed because one or more lines are too long