Not sure if this is an abuse of the Akka Remoting system, but I'm wondering if adding proxy support for Tell / Ask is warranted.
The goal is support for N homogeneous, stateless, backend/server actor systems load balanced across several nodes.
I've been playing with the following "ugly", but works in principle approach this morning.
1. Fire up two Amazon AWS server nodes. S1 -> IP1, S2 -> IP2 (IP address)
2. On each node edit their /etc/hosts file and define the host "calcserver" to be their respective IP.
3. Configured for remoting, each server on startup, creates actor system "calcsys", and then creates a round-robin routing actor "calculator" with N calculator workers. Say on port 8080.
4. Note their application.conf remote.netty.hostname = "calcserver".
Now we have 2 (could be M) identical Actor System servers on different nodes, each with N worker routee actors. Both are remotely addressable as
akka://calcsys@calcserver:8080/user/calculator.
Of course the Calculator actors are stateless between calculation requests.
Next place these servers behind an Amazon AWS Elastic Load Balancer, with IP-ELB, which round-robins TCP connection requests.
Now create some "clients" and for each client in their respective /etc/hosts define the host "calcserver" to be the IP-ELB (the IP address of the load balancer). Note here their application.conf remote.netty.hostname = "", i.e. blank or explicitly their IP, so response messages are correctly routed back to the requesting client.
Now when a client node performs an Ask (?) to akka://calcsys@calcserver:8080/user/calculator, the request is sent to the load balancer, and when a new connection is needed, round-robins a connection to one of the backend actor system servers. It doesn't matter which one as Routing sends the Tell/Ask response back to the correct "client" actor system.
Very limited testing so far, but I believe this works in Akka 2.0.2.
"Crash" a server, remove / add servers to the LB and scale up and down. The LB auto removes "dead" servers etc. Easy peasy.
So ...
1. First, does Akka has something already out-of-the-box that I missed which offers a highly available, scalable set of stateless worker actors, load balanced across N dynamic nodes?
2. Assuming this is ok, admittedly ugly, but gets the job done, any consideration for adding "native" support for this pattern into Akka.
- For "clients" say along the lines of configuration support for proxies:
hostproxy {
calcserver:8080=w.x.y.z:p // i.e. all messages to akka://calcsys@calcserver:8080/user/... get are really "sent" to IP-ELB w.x.y.z and port p
}