Skip to content

search-blitz: jitter sleep instead of ticker

Warren Gifford requested to merge k/search-blitz-jitter into main

Created by: keegancsmith

Using a ticker means a query will always run at a specific moment every minute. By introducing jitter we avoid predictable behaviour. We jitter by 25% between each query. In practice this means we sleep for 45s -> 1m15s between each request.

The other change here is how long we sleep is affected by how slow the query we run is. This seems fine, since most queries are very fast and the jitter is much larger than the query runtime.

A reason against doing this change is we are now less predictable. IE we can't rule out bad luck (all queries running at the same time). This be a very good reason to not do this change.

Merge request reports

Loading