NuRaft
NuRaft copied to clipboard
Avoiding Raft thread starvation
I observed that when system is heavy loaded, raft is missing heartbeat and leading to re-election. How do you avoid raft thread starvation? Do you do thread pinning? Is there any other alternative solutions? How to configure NuRaft to avoid Raft thread starvation?
Hi @kishorekrd
There is no dedicated thread for heartbeats; the heartbeat timer is controlled by Asio and invoked on any worker threads. So there is virtually no way to guarantee heartbeating by NuRaft.
But if the leader too overloaded to generate heartbeats, isn't it enough to say the leader is "unhealthy" so that the leader election is desired?