Advertisement
Guest User

ceph backfill throttler

a guest
Sep 10th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.11 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ACTIVE=$1
  4. INACTIVE=$2
  5.  
  6. if [[ -z "$INACTIVE" ]]; then
  7.         echo "missing parameter (time balancing / time sleeping)"
  8.         exit
  9. fi
  10.  
  11. clean_exit() {
  12.         echo "Resetting max-backfills/recovery-max-active to 1"
  13.         ./ceph tell osd.* injectargs "'--osd-max-backfills 1'" &>/dev/null
  14. #       ./ceph tell osd.* injectargs "'--osd-recovery-max-active 1'" &>/dev/null
  15.         echo "Ctrl-C if you want to skip scrub reactivation"
  16.         read
  17.         ./ceph osd unset noscrub
  18.         ./ceph osd unset nodeep-scrub
  19.         exit
  20. }
  21.  
  22. trap clean_exit INT
  23.  
  24. ./ceph osd set nodeep-scrub
  25. ./ceph osd set noscrub
  26. while `true`; do
  27.         echo "Sleeping"
  28.         ./ceph tell osd.* injectargs "'--osd-max-backfills 0'" &>/dev/null
  29. #       ./ceph tell osd.* injectargs "'--osd-recovery-max-active 0'" &>/dev/null
  30.         sleep $INACTIVE
  31.         ./ceph -s
  32.         echo "Backfilling/Recovering"
  33.         ./ceph tell osd.* injectargs "'--osd-max-backfills 1'" &>/dev/null
  34. #       ./ceph tell osd.* injectargs "'--osd-recovery-max-active 1'" &>/dev/null
  35.         sleep $ACTIVE
  36.         ./ceph -s
  37. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement