forked from linkerd/linkerd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jitter to Marathon namer poll interval (linkerd#171) (linkerd#1448)
* Add jitter to Marathon poll attempts (linkerd#171) For very large clusters, if a bunch of linkerds all poll the Marathon namer at exactly the same time, the namer can be overloaded. I've added a slight random jitter to poll attempts, based on the formula suggested by @adelong in comments on PR linkerd#772. The jitter amount is configurable in YAML. Note that I decided to just pass a function from MarathonInitializer to AppIdNamer, rather than pass a Stream as @adelong recommended on linkerd#772 – this seemed simpler & thus more elegant. Annotating the jitter function with `@inline` should prevent it from creating a new call stack, so performance is probably about the same as using a `Stream`. I've added a handful of tests for this: we test that the correct values are parsed from the config file, that a respectable sample of the jittered TTLs are within the expected range, and that at least 50% of the random values are unique. Fixes linkerd#171 Signed-off-by: Eliza Weisman <[email protected]> * Fix incorrect lower bound in jitter tests I forgot to subtract the maximum jitter amount from the expected lower bound - my bad! Signed-off-by: Eliza Weisman <[email protected]> * Fix incorrect lower bound in jitter tests I forgot to subtract the maximum jitter amount from the expected lower bound - my bad! Signed-off-by: Eliza Weisman <[email protected]> * Make jitter tests expect a more reasonable number of collisions Signed-off-by: Eliza Weisman <[email protected]> * Reduce the number of expected unique TTLs again @adelong suggested this (linkerd#1448 (comment)) and...he's probably right.
- Loading branch information
Showing
3 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters