Ajay Kumar
Ajay Kumar

Reputation: 618

ioredis | slotsRefreshTimeout & slotsRefreshInterval meaning

Want to understand the meaning of these two fields slotsRefreshTimeout & slotsRefreshInterval in ioredis library for nodejs. how does it impact the client side if these are set as default values.

I have been seeing some connection issues in the redis in production.

Upvotes: 0

Views: 693

Answers (1)

Efran Cobisi
Efran Cobisi

Reputation: 6464

Both slotsRefreshTimeout and slotsRefreshInterval are used by ioredis to adjust the monitoring process of the nodes in a Redis cluster, so that the client can have an up-to-date snapshot of the Redis topology and the distribution of its hash slots: ioredis keeps a secondary connection opened against the target node to poll and monitor its clustering and replication information.

From the ioredis docs:

slotsRefreshTimeout: Milliseconds before a timeout occurs while refreshing slots from the cluster (default 1000).

slotsRefreshInterval: Milliseconds between every automatic slots refresh (default 5000).

The default values are fine for most scenarios I can think of.

Upvotes: 1

Related Questions