Skip to content

Instantly share code, notes, and snippets.

@jimklimov
jimklimov / zfs recv lags discussion.txt
Created August 12, 2020 13:42
zfs recv lags discussion
(2020-08-10 02:40:30) jimklimov: cheers all who won't sleep :) doing some ZFS replications and hit that annoyance again about how slow it is to `zfs recv` many small snapshots. Is there some tunable to speed it up a bit? Looking at speed numbers in the console, it seems that for every incremental snapshot it spends over 60s regardless of size. So empty 312byte snapshots take a minute at average 5 b/s, and larger multimegabyte snaps take 70s, and huge ones average at relatively decent looking speeds in MB/s range. What can I do to not wait that 1 minute every snap?
(02:47:40) jimklimov: looking at the consoles, I see it doing zero I/O on source and destination pools (zpool iostat 1), then the send|recv pipe says "receiving incremental stream of X into Y" and there is a burst of I/O for a second, and the pipe logs how it received a few kilobytes in a lot of seconds...
(02:58:43) jimklimov: using Adam's scripts from http://dtrace.org/blogs/ahl/2014/08/31/openzfs-tuning/ I see that the destination pool txg-syncin
@jimklimov
jimklimov / gist:d97d6b68f967cb5e648369fddd395276
Last active May 22, 2020 12:11
Real-time debugging in systemd
`systemctl log-level debug`, previously `systemd-analyze log-level debug`, or a specific signal (see systemd(1))
for a single invokation can pass the envvar, e.g.: `SYSTEMD_LOG_LEVEL=debug systemctl daemon-reexec`
@jimklimov
jimklimov / ssh_config
Created April 9, 2020 09:27 — forked from rbenaley/ssh_config
GitHub ssh access via HTTP Proxy
host github.com
user git
hostname ssh.github.com
port 443
proxycommand socat - PROXY:<hostname>:%h:%p,proxyport=<port>
@jimklimov
jimklimov / jenkins-script-console-joblist.groovy
Last active June 26, 2019 09:19
List currently known Jenkins jobs along with their status and labels, if any
// List currently known Jenkins jobs along with their status and labels, if any.
// Primary use-case for us is to find enabled obsolete jobs, we have a few
// we don't want deleted just yet, and to avoid enabled jobs without an agent
// label assigned so they are not picked up by random unsuitable machines.
import hudson.model.Job
//getAllItems searches a global lookup table of items regardless of folder structure
Jenkins.instance.getAllItems(Job.class).each { Job job ->
String jobLabelString
@jimklimov
jimklimov / local.sh
Created April 4, 2018 13:18 — forked from bk2204/local.sh
Reasonably portable technique for local variables in shell scripts
#!/bin/sh -e
# This shell script demonstrates how to use the local keyword to create
# dynamically-scoped variables in various shells. Notably, this technique works
# with AT&T ksh, as well as bash, dash, mksh, pdksh, zsh, busybox sh, and other
# Debian Policy-compliant sh implementations.
# Simple Perl-compatible testing framework. Produces TAP output.
COUNT=0
is () {