Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only check latencies once every 10 seconds with
routeByLatency
(#2795)
* Only check latencies once every 10 seconds with `routeByLatency` `routeByLatency` currently checks latencies any time a server returns a MOVED or READONLY reply. When a shard is down, the ClusterClient chooses to issue the request to a random server, which returns a MOVED reply. This causes a state refresh and a latency update on all servers. This can lead to significant ping load to clusters with a large number of clients. This introduces logic to ping only once every 10 seconds, only performing a latency update on a node during the `GC` function if the latency was set later than 10 seconds ago. Fixes #2782 * use UnixNano instead of Unix for better precision --------- Co-authored-by: ofekshenawa <[email protected]>
- Loading branch information