ktoso / akka-raft

A toy project implementing RAFT on top of Akka Cluster (not prod ready)
http://blog.project13.pl
Apache License 2.0
280 stars 42 forks source link

Would get better performance if akka-raft used udp #53

Open colin-scott opened 9 years ago

colin-scott commented 9 years ago

It looks like akka-raft is configured by default to use TCP between nodes.

I would bet that the implementation could get notably better performance if it used UDP, by avoiding all of the extra network delays implied by TCP. The raft protocol should be resilient to message reorderings, duplicates, drops, etc.

ktoso commented 9 years ago

That one would be really hard to change as Akka does not provide a transport over UDP yet (we're temped by it, but it would need a remoting rewrite).

I'll keep the ticked open as a reminder, but it's not something immediately actionable until an Akka remoting rewrite happens.

dmitraver commented 9 years ago

Good point. @ktoso Are you considering contributions for features like that? As far as I know akka remoting supports plugable transport implementation or its more complicated than that?

dmitraver commented 9 years ago

It looks like akka remoting supports transport via udp. Netty transport has an udp mode. I've just tried to change the activator template akka-sample-remote-scala to use udp

remote {
    enabled-transports = ["akka.remote.netty.udp"]
    ...
}

and it works.

ktoso commented 9 years ago

I wouldn't say this is a direction I'd like to pursue currently, first I'd like to nail correctness. Since this will be most likely used in Akka Clusters, TCP makes much sense in there, therefore switching to UDP does not seem very realistic for those kinds of deployments (at least with the current remoting impl).

It's a neat idea, but I'd rather stash it for now.