nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

Tweak initial filestore sync timer #6128

Closed neilalexander closed 1 week ago

neilalexander commented 1 week ago

Previously this was always firing at the exact interval. Then #6041 changed this so that the first firing was anytime between 1s and the interval to spread out different stores. This tweaks it once more to anytime between interval/2 and interval. It will still spread things out a bit but hit the benchmarks a bit less badly.

Also go back to math/rand instead of math/rand/v2 due to availability in Go versions that we still care about for 2.10.x.

Signed-off-by: Neil Twigg neil@nats.io