Remoting Load Balancing

361 views
Skip to first unread message

Ray Racine

unread,
Jul 17, 2012, 2:29:51 PM7/17/12
to akka...@googlegroups.com
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
}

















Akka Team

unread,
Jul 31, 2012, 9:15:24 AM7/31/12
to akka...@googlegroups.com
This will be a feature of the upcoming clustered actor refs.

Cheers,


>
> 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
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

Gonzalo Vasquez

unread,
Jul 31, 2012, 9:43:56 AM7/31/12
to akka...@googlegroups.com
V, when is this feature planned as an akka release? Any time soon?

Regards,

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 

√iktor Ҡlang

unread,
Jul 31, 2012, 9:45:22 AM7/31/12
to akka...@googlegroups.com
On Tue, Jul 31, 2012 at 3:43 PM, Gonzalo Vasquez <gvas...@altiuz.cl> wrote:
V, when is this feature planned as an akka release? Any time soon?

It's currently slated for 2H2012



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Firma_medio ambiente_mail.jpg

Gonzalo Vasquez

unread,
Jul 31, 2012, 9:46:43 AM7/31/12
to akka...@googlegroups.com
Nice to know! Any alpha or beta versions on such already available?

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
 


El 31-07-2012, a las 9:45, √iktor Ҡlang <viktor...@gmail.com> escribió:

On Tue, Jul 31, 2012 at 3:43 PM, Gonzalo Vasquez <gvas...@altiuz.cl> wrote:
V, when is this feature planned as an akka release? Any time soon?

It's currently slated for 2H2012
 

Regards,

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 

<Firma_medio ambiente_mail.jpg>

√iktor Ҡlang

unread,
Jul 31, 2012, 9:55:04 AM7/31/12
to akka...@googlegroups.com
On Tue, Jul 31, 2012 at 3:46 PM, Gonzalo Vasquez <gvas...@altiuz.cl> wrote:
Nice to know! Any alpha or beta versions on such already available?

No, not yet, we are currently working on hardening the cluster membership so we can start building things on top of that, where distributed routers are one such feature.

Cheers,
Firma_medio ambiente_mail.jpg

beagledude

unread,
Aug 8, 2012, 7:29:08 PM8/8/12
to akka...@googlegroups.com
give the current 2.0.2 codebase that is void of that feature as a reference would the above be a reasonable approach as outlined? 

Roland Kuhn

unread,
Aug 9, 2012, 6:01:05 AM8/9/12
to akka...@googlegroups.com
You might want to read Derek’s new post: http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2

Regards,

Roland

To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/t0FfWUZ3DucJ.

To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn


Fábio Melo

unread,
Mar 29, 2016, 12:15:48 PM3/29/16
to Akka User List
This approach still works with currently version of akka?

regards,
Fábio

Patrik Nordwall

unread,
Mar 29, 2016, 12:26:18 PM3/29/16
to akka...@googlegroups.com
Yes, it works and is still a very relevant pattern.
/Patrik

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.

matt.s...@latch.com

unread,
Mar 15, 2017, 10:44:24 AM3/15/17
to Akka User List
Thanks for the explanation, Ray!!

With regards to this pattern, what if calcserver wants to call other remote akka actors, or equivalently, if the client is also a server? Why do we need to change the hostname on all of the calc servers (application.conf remote.netty.hostname = "calcserver")? Can't we just use application.conf remote.netty.hostname = "IP1" and still redirect traffic via the load balancer? Is there some reason this wouldn't work??

Thanks in advance,
Matt
Reply all
Reply to author
Forward
0 new messages