Skip to content

Instantly share code, notes, and snippets.

View ceph-iosched
# prefer cfq (el7), then bfq (el8), then do nothing
if grep -q cfq /sys/block/sd*/queue/scheduler; then
# tune SSDs to use cfq scheduler and spinning disks to use cfq also
for DISK in /sys/block/sd*; do grep -q 0 ${DISK}/queue/rotational && echo cfq > ${DISK}/queue/scheduler; done
for DISK in /sys/block/sd*; do grep -q 1 ${DISK}/queue/rotational && echo cfq > ${DISK}/queue/scheduler; done
# tune cfq not to penalize writes when reading heavily
dvanders /
Last active May 5, 2020
#!/usr/bin/env python3
# The goal of this is to gradually balance a btrfs filesystem which contains DM-SMR drives.
# Such drive are described in detail at
# A normal drive should be able to balance a single 1GB chunk in under 30s.
# Such a stripe would normally be written directly to the shingled blocks, but in the case
# it was cached, it would take roughly 100s to clean.
# So our heuristic here is:
dvanders / gist:ebe124cf9bdf0af9621cc2c6c6d450bf
Last active Apr 23, 2020
efi software md raid1 for kickstart
View gist:ebe124cf9bdf0af9621cc2c6c6d450bf
ignoredisk --only-use=sda,sdb
clearpart --all --initlabel --drives sda,sdb
# for /boot
partition raid.01 --size 1024 --ondisk sda
partition raid.02 --size 1024 --ondisk sdb
# for /boot/efi
partition raid.11 --size 256 --ondisk sda
partition raid.12 --size 256 --ondisk sdb
View gist:7eca771b6a8d1164bae8ea1fe45cf9f2
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
fsid = xxx
debug filestore = 1
debug mon = 1
debug osd = 1
dvanders / haproxy.cfg
Created Jul 11, 2017
CERN haproxy.cfg
View haproxy.cfg
# This file managed by Puppet
chroot /var/lib/haproxy
group haproxy
log local0
maxconn 2048
pidfile /var/run/
stats socket /var/lib/haproxy/stats level admin
tune.ssl.default-dh-param 2048

Keybase proof

I hereby claim:

  • I am dvanders on github.
  • I am dvanders ( on keybase.
  • I have a public key ASAJy2L7fN70X5n0vp7FyhL1m4jydu-WyRLpDc-ijtpNdAo

To claim this, I am signing this object:

View gist:f3b08373af0f5957f589
diff --git a/src/osd/ b/src/osd/
index 0562eed..1a2d397 100644
--- a/src/osd/
+++ b/src/osd/
@@ -1809,6 +1809,15 @@ int OSD::init()
dout(2) << "boot" << dendl;
+ // initialize the daily loadavg with current 15min loadavg
+ double loadavgs[3];