Commit 989a7df
committed
rebalance: introduce go-carbon health check with better sync rate control
The original sync mechanism is a bit too simple, as it is controllyed by only workers.
It is hard to balance both efficiency and reliability. Setting the worker count too low,
rebalancing becomes too slow; setting it too high, buckyd might take away too much
resources.
To meet both criteria, this changes introduced a go-carbon health check and a automatic
sync rate adjustments based on metrics per second per node.
bucky rebalance -f -offload -ignore404 \
-graphite-ip-to-hostname \
-graphite-metrics-prefix carbon.minutely.buckytool.rebalance.$cluster.dst.$to_location.src.$from_location \
-graphite-endpoint 127.0.0.1:3002 \
-go-carbon-health-check=$enable_go_carbon_health_check \
-go-carbon-health-check-interval 5 \
-go-carbon-port 8080 \
-go-carbon-protocol http \
-go-carbon-cache-threshold 0.5 \
-sync-speed-up-interval $sync_speed_up_interval \
-metrics-per-second $sync_metrics_per_second \
-h ${seed_node}:4242 \
-workers $workers \
-timeout $timeout
Using the above example for explanation:
-go-carbon-health-check=true: asks buckytools to check go-carbon cache usage, which indicates if there is capacity issues.
-sync-speed-up-interval: means increased sync rate (metrics per second) every specified seconds.
-metrics-per-second: means the initial sync rate. Should be set to a lower value like 5 - 10 initially while using -sync-speed-up-interval.
Whats more, with go-carbon health check, buckytools also does automatic sync rate easing. Could be disabled by `-no-random-easing=false`.
Full flags could be found with `bucky rebalance -help`.
Besides go-carbon health check, this commits also introduce exporting some internal sync rate metrics to graphite
for monitoring. Could be enabled by -graphite-metrics-prefix.
By default -go-carbon-health-check is disabled, which means buckytools fallback to the original sync behaviour.
Relevant go-carbon PR: go-graphite/go-carbon#4331 parent ee866ed commit 989a7df
File tree
7 files changed
+715
-66
lines changed- cmd/bucky
- testing
7 files changed
+715
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
0 commit comments