Commit f1ffb55
Only check latencies once every 10 seconds with
* 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 <104765379+ofekshenawa@users.noreply.github.com>routeByLatency (#2795)1 parent 080e051 commit f1ffb55
1 file changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
319 | 327 | | |
320 | 328 | | |
321 | 329 | | |
| |||
368 | 376 | | |
369 | 377 | | |
370 | 378 | | |
| 379 | + | |
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| |||
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
400 | 413 | | |
401 | 414 | | |
402 | 415 | | |
| |||
406 | 419 | | |
407 | 420 | | |
408 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
409 | 431 | | |
410 | 432 | | |
411 | 433 | | |
| |||
493 | 515 | | |
494 | 516 | | |
495 | 517 | | |
| 518 | + | |
496 | 519 | | |
497 | 520 | | |
498 | 521 | | |
499 | | - | |
| 522 | + | |
500 | 523 | | |
501 | 524 | | |
502 | 525 | | |
| |||
0 commit comments