Benchmark and Optimize Raft

Moved from GitHub dgraph/2975

Posted by manishrjain:

I’m seeing that after proposing a mutation, it is taking over 130ms just to see it back in CommitedEntries. We should try to figure out why it takes this long to see the mutation back via Raft. What is the slowdown here? SaveToStorage, the comms, or something else?

manishrjain commented :

One of the things might be that raft.Advance is slow, and needs optimization – one of the things that needs to be done there is to add a cache in front of LastEntry API call in raft storage.