hacks as of 9 mar

master
Jeffrey Paul 4 years ago
parent 41ceec25dd
commit c24e396a5d
  1. 43
      download-starred-github-repos/download-starred-github-repos.sh
  2. 2
      fsn1.disktest/.gitignore
  3. 5
      fsn1.disktest/Makefile
  4. 178
      fsn1.disktest/disktest.sh
  5. 19
      nbg1.disktest/Makefile
  6. 72
      nbg1.disktest/disktest.sh
  7. 9
      nbg1.disktest/log.2020-02-28.21.46.16.txt
  8. 692
      nbg1.disktest/log.2020-02-28.21.46.25.txt

@ -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

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

@ -7,10 +7,13 @@ runlog:
script ./log.$(WHEN).txt bash -c "make run"
run: sync
ssh root@$(HOST) "bash /root/disktest.sh"
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

@ -1,12 +1,6 @@
#!/bin/bash
set -x
set -e
date -u
zfs version
killall fio || true
sleep 1
RAWDISKS=$(
cd /dev/disk/by-id ;
@ -18,54 +12,124 @@ for RAWDISK in $RAWDISKS ; do
FULLPATHS+=" /dev/disk/by-id/$RAWDISK"
done
PN="tank"
POOLNAME="tank"
MPT="/srv/z"
JOBFILE="/tmp/jobfile.fio"
KEYLOC="/tmp/testkey.raw"
function main() {
show_system_info
prep_system
do_direct_tests
do_zfs_tests
}
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
}
if [[ -e $MPT/.zfs ]]; then
zpool destroy $PN
fi
lsblk -t
for ASHIFTVAL in 12 13 14 15 16 ; do
function print_divider() {
echo '##############################################################'
echo '##############################################################'
}
function trim_disks() {
for DISK in $FULLPATHS ; do
blkdiscard $DISK
nvme format $DISK
nvme format -r $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]
print_divider
echo "################## waiting 60s for nvme format to complete..."
sleep 60
nvme list
}
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
if [[ -e $MPT/.zfs ]]; then
zpool destroy $POOLNAME
fi
}
function do_zfs_tests() {
for ASHIFTVAL in 12 13 14 15 16 ; do
trim_disks
print_divider
zpool create $POOLNAME \
-o ashift=$ASHIFTVAL -O mountpoint=$MPT \
raidz1 $FULLPATHS
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
directory=$MPT/$DIRNAME/
iodepth=64
@ -73,18 +137,20 @@ ioengine=libaio
readwrite=readwrite
numjobs=$NJ
nrfiles=$NJ
size=$(expr 400000 / $NJ)M
runtime=300
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
done
cat $JF
fio $FO $JF
zpool destroy $PN
done
zpool destroy $POOLNAME
done
}
main

@ -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

@ -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

@ -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
Loading…
Cancel
Save