NuRaft icon indicating copy to clipboard operation
NuRaft copied to clipboard

Avoiding Raft thread starvation

Open kishorekrd opened this issue 3 years ago • 1 comments

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?

kishorekrd avatar May 20 '22 00:05 kishorekrd

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?

greensky00 avatar May 23 '22 16:05 greensky00