Skip to content

Commit 5dbd2e1

Browse files
author
Shlomi Noach
committed
clarifying meaning of sleep-ratio
1 parent d9ae2f3 commit 5dbd2e1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/interactive-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ replication lag on to determine throttling
2222
- `max-load=<max-load-thresholds>`: modify the `max-load` config; applies on next running copy-iteration
2323
The `max-load` format must be: `some_status=<numeric-threshold>[,some_status=<numeric-threshold>...]`. For example: `Threads_running=50,threads_connected=1000`, and you would then write/echo `max-load=Threads_running=50,threads_connected=1000` to the socket.
2424
- `critical-load=<load>`: change critical load setting (exceeding given thresholds causes panic and abort)
25-
- `nice-ratio=<ratio>`: change _nice_ ratio: 0 for aggressive, positive integer `n`: for any unit of time spent copying rows, spend `n` units of time sleeping.
25+
- `nice-ratio=<ratio>`: change _nice_ ratio: 0 for aggressive (not nice, not sleeping), positive integer `n`: for any `1ms` spent copying rows, spend `n*1ms` units of time sleeping. Examples: assume a single rows chunk copy takes `100ms` to complete. `nice-ratio=0.5` will cause `gh-ost` to sleep for `50ms` immediately following. `nice-ratio=1` will cause `gh-ost` to sleep for `100ms`, effectively doubling runtime; value of `2` will effectively triple the runtime; etc.
2626
- `throttle-query`: change throttle query
2727
- `throttle-control-replicas`: change list of throttle-control replicas, these are replicas `gh-ost` will check
2828
- `throttle`: force migration suspend

go/cmd/gh-ost/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func main() {
7373
chunkSize := flag.Int64("chunk-size", 1000, "amount of rows to handle in each iteration (allowed range: 100-100,000)")
7474
defaultRetries := flag.Int64("default-retries", 60, "Default number of retries for various operations before panicking")
7575
cutOverLockTimeoutSeconds := flag.Int64("cut-over-lock-timeout-seconds", 3, "Max number of seconds to hold locks on tables while attempting to cut-over (retry attempted when lock exceeds timeout)")
76-
niceRatio := flag.Float64("nice-ratio", 0, "force being 'nice', imply sleep time per chunk time; range: [0.0..100.0]. Example values: 0 is aggressive. 1.5: for every ms spend in a rowcopy chunk, spend 1.5ms sleeping immediately after")
76+
niceRatio := flag.Float64("nice-ratio", 0, "force being 'nice', imply sleep time per chunk time; range: [0.0..100.0]. Example values: 0 is aggressive. 1: for every 1ms spent copying rows, sleep additional 1ms (effectively doubling runtime); 0.7: for every 10ms spend in a rowcopy chunk, spend 7ms sleeping immediately after")
7777

7878
maxLagMillis := flag.Int64("max-lag-millis", 1500, "replication lag at which to throttle operation")
7979
replicationLagQuery := flag.String("replication-lag-query", "", "Query that detects replication lag in seconds. Result can be a floating point (by default gh-ost issues SHOW SLAVE STATUS and reads Seconds_behind_master). If you're using pt-heartbeat, query would be something like: SELECT ROUND(UNIX_TIMESTAMP() - MAX(UNIX_TIMESTAMP(ts))) AS delay FROM my_schema.heartbeat")

go/logic/migrator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ func (this *Migrator) onServerCommand(command string, writer *bufio.Writer) (err
664664
fmt.Fprintln(writer, `available commands:
665665
status # Print a status message
666666
chunk-size=<newsize> # Set a new chunk-size
667-
nice-ratio=<ratio> # Set a new nice-ratio, integer (0 is agrressive)
667+
nice-ratio=<ratio> # Set a new nice-ratio, immediate sleep after each row-copy operation, float (examples: 0 is agrressive, 0.7 adds 70% runtime, 1.0 doubles runtime, 2.0 triples runtime, ...)
668668
critical-load=<load> # Set a new set of max-load thresholds
669669
max-lag-millis=<max-lag> # Set a new replication lag threshold
670670
replication-lag-query=<query> # Set a new query that determines replication lag (no quotes)

0 commit comments

Comments
 (0)