3 ms·
We use this quite a bit but we actually have a constant timeout with random "jitter" added to it. You almost never want the timeout completely randomized becau
by smoyer 7y ago
We use this quite a bit but we actually have a constant timeout with random "jitter" added to it. You almost never want the timeout completely randomized because there's a chance you'll get a zero.
- klodolph 7y agoThe concept of “completely randomizing” something isn’t really well-defined, it’s more of a casual phrase that people use without thinking about it. If you have a constant timeout with random jitter added to it, you’ve randomized it. It is now random. If you think about it, a “perfectly random” die roll on an ordinary die will never be 0. So, whether a value is random has no relationship with whether that value can be 0.
- ed_balls 7y agoyou don't want it random. You want to add a splay .e.g # add a random value (from 0 to X) to the timeout # This can be used to prevent the thundering herd problem splay = "5s"