I know Akka Cluster is still marked as experimental, but I wanted to give more detailed feedback on some of the testing today, as well as post some questions.
- ClusterAwareRouter / lookup routees by name: This seems like the most stable config so far. Removing and adding nodes back seems to lead to the correct rebalancing every time.
- It's really too bad that you can only look up one routee per node. Can that routee be itself a local router? Otherwise we would have to be bound to one mailbox for all incoming requests per node, and that won't scale.
- How hard would it be to change the code so that routees-path could take a wildcard? The idea is that all the actors discovered in the selection would be added to the router config.
- ClusterAwareRouter / deploy routees: I don't understand the intention of this.
- If only one master deploys the actors, then the router is only usable from that one master.
- If multiple masters all deploy the actors, then you end up with (# masters) * (max-nr-of-instances-per-node) * (# nodes) actors, which is probably not what you want, plus each master's router will only know about the routees it created, and not the other created ones.
- If you remove one node, and then add it back, the actors are not redeployed.
- Ultimately what I want is to have (n-instances-per-node), with routers on all nodes being able to talk to all (the same) instances.
- You can get an exception easily if you have each node start up a router which attempts to deploy to the other cluster members. Not sure if this is really supported scenario. Even with one master, if you remove one of the nodes (like in StatsSampleOneMaster), you may get an exception like this:
- scala.MatchError: Actor[akka://ClusterSystem/remote/Cluste...@127.0.0.1:2551/user/statsService/workerRouter/c6] (of class akka.actor.LocalActorRef)
- at akka.remote.RemoteSystemDaemon$$anonfun$$bang$3.apply(RemoteDaemon.scala:105)
- at akka.remote.RemoteSystemDaemon$$anonfun$$bang$3.apply(RemoteDaemon.scala:105)
- at akka.actor.VirtualPathContainer.foreachChild(ActorRef.scala:535)
- at akka.remote.RemoteSystemDaemon.$bang(RemoteDaemon.scala:105)
- at akka.event.EventStream.publish(EventStream.scala:40)
I would really love to use the Cluster aware router stuff, because I want to be able to use different underlying routers, like RoundRobin, Random, and ConsistentHash. However, it seems that today only the lookup-one-routee-per-node method really works.
thanks,Evan--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
Patrik Nordwall
Typesafe - The software stack for applications that scale
Twitter: @patriknw
I know Akka Cluster is still marked as experimental, but I wanted to give more detailed feedback on some of the testing today, as well as post some questions.
- ClusterAwareRouter / lookup routees by name: This seems like the most stable config so far. Removing and adding nodes back seems to lead to the correct rebalancing every time.
- It's really too bad that you can only look up one routee per node. Can that routee be itself a local router? Otherwise we would have to be bound to one mailbox for all incoming requests per node, and that won't scale.
- How hard would it be to change the code so that routees-path could take a wildcard? The idea is that all the actors discovered in the selection would be added to the router config.
- ClusterAwareRouter / deploy routees: I don't understand the intention of this.
- If only one master deploys the actors, then the router is only usable from that one master.
- If multiple masters all deploy the actors, then you end up with (# masters) * (max-nr-of-instances-per-node) * (# nodes) actors, which is probably not what you want, plus each master's router will only know about the routees it created, and not the other created ones.
- If you remove one node, and then add it back, the actors are not redeployed.
- Ultimately what I want is to have (n-instances-per-node), with routers on all nodes being able to talk to all (the same) instances.
- You can get an exception easily if you have each node start up a router which attempts to deploy to the other cluster members. Not sure if this is really supported scenario. Even with one master, if you remove one of the nodes (like in StatsSampleOneMaster), you may get an exception like this:
- scala.MatchError: Actor[akka://ClusterSystem/remote/Cluste...@127.0.0.1:2551/user/statsService/workerRouter/c6] (of class akka.actor.LocalActorRef)
- at akka.remote.RemoteSystemDaemon$$anonfun$$bang$3.apply(RemoteDaemon.scala:105)
- at akka.remote.RemoteSystemDaemon$$anonfun$$bang$3.apply(RemoteDaemon.scala:105)
- at akka.actor.VirtualPathContainer.foreachChild(ActorRef.scala:535)
- at akka.remote.RemoteSystemDaemon.$bang(RemoteDaemon.scala:105)
- at akka.event.EventStream.publish(EventStream.scala:40)
I would really love to use the Cluster aware router stuff, because I want to be able to use different underlying routers, like RoundRobin, Random, and ConsistentHash. However, it seems that today only the lookup-one-routee-per-node method really works.
thanks,Evan--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
On Fri, Oct 26, 2012 at 1:15 AM, Evan Chan <e...@ooyala.com> wrote:I know Akka Cluster is still marked as experimental, but I wanted to give more detailed feedback on some of the testing today, as well as post some questions.
- ClusterAwareRouter / lookup routees by name: This seems like the most stable config so far. Removing and adding nodes back seems to lead to the correct rebalancing every time.
Good. Yes that setup makes sense in a lot of cases.
- It's really too bad that you can only look up one routee per node. Can that routee be itself a local router? Otherwise we would have to be bound to one mailbox for all incoming requests per node, and that won't scale.
The routee can create and delegate to it's own children to increase parallelism. Yes, it can be a router.
Hi Patrik,
On Friday, October 26, 2012 3:45:59 AM UTC-7, Patrik Nordwall wrote:
On Fri, Oct 26, 2012 at 1:15 AM, Evan Chan <e...@ooyala.com> wrote:I know Akka Cluster is still marked as experimental, but I wanted to give more detailed feedback on some of the testing today, as well as post some questions.
- ClusterAwareRouter / lookup routees by name: This seems like the most stable config so far. Removing and adding nodes back seems to lead to the correct rebalancing every time.
Good. Yes that setup makes sense in a lot of cases.
- It's really too bad that you can only look up one routee per node. Can that routee be itself a local router? Otherwise we would have to be bound to one mailbox for all incoming requests per node, and that won't scale.
The routee can create and delegate to it's own children to increase parallelism. Yes, it can be a router.
There is a more fundamental problem than scalability, actually. Suppose I want to use a ConsistentHashingRouter. The state of the hashing is kept in the master router itself. If I have a local router on each node, would it be able to sub-hash on the message? IE, the flow becomes:Master node: ConsistentHashingRouter:- based on the hashing key, it routes the message to the remote routeeRemote node: remote routee is itself a consistent hashing router- Does this router see the hashing envelope?- It needs to do sub-hashing somehow
There is a more fundamental problem than scalability, actually. Suppose I want to use a ConsistentHashingRouter. The state of the hashing is kept in the master router itself. If I have a local router on each node, would it be able to sub-hash on the message? IE, the flow becomes:
Master node: ConsistentHashingRouter:- based on the hashing key, it routes the message to the remote routeeRemote node: remote routee is itself a consistent hashing router- Does this router see the hashing envelope?- It needs to do sub-hashing somehowThe envelope approach doesn't work, but there are two more ways to define the consistent hash key. Have you considered if you can use any of them?I would also like to mention that the routers are not the silver bullet that fits every problem. It's easy and often very appropriate to use an ordinary actor and implement the "routing" yourself in the actor. Round robin and random are trivial one-liners, and for consistent cashing you can use the akka.routing.ConsistentHash utility. To manage the routee references you can subscribe to cluster events as is done in StatsSampleClient.
Cheers,Patrik
Patrick & co.:Response inlined. By the way it's quite a privilege to have discussions with a community so well versed in distributed and concurrency problems.On Sat, Oct 27, 2012 at 12:09 AM, Patrik Nordwall <patrik....@gmail.com> wrote:
There is a more fundamental problem than scalability, actually. Suppose I want to use a ConsistentHashingRouter. The state of the hashing is kept in the master router itself. If I have a local router on each node, would it be able to sub-hash on the message? IE, the flow becomes:
Master node: ConsistentHashingRouter:- based on the hashing key, it routes the message to the remote routeeRemote node: remote routee is itself a consistent hashing router- Does this router see the hashing envelope?- It needs to do sub-hashing somehowThe envelope approach doesn't work, but there are two more ways to define the consistent hash key. Have you considered if you can use any of them?I would also like to mention that the routers are not the silver bullet that fits every problem. It's easy and often very appropriate to use an ordinary actor and implement the "routing" yourself in the actor. Round robin and random are trivial one-liners, and for consistent cashing you can use the akka.routing.ConsistentHash utility. To manage the routee references you can subscribe to cluster events as is done in StatsSampleClient.Here is the description of routers from the Akka docs:"Routers behave like single actors, but they should also not hinder scalability".Sure I can embed the routing logic in each end point actor, but not only would this violate DRY, but any kind of routing that relies on state (round-robin, or dynamic resizing) would be really difficult to coordinate and not practical. This is especially true for a cluster wide router.Routers on a single node (JVM) satisfy this property and are extremely appealing for that reason. Currently the cluster router does not satisfy the description above. They may behave like a single actor, but if you pass the cluster aware router ActorRef around the cluster, the routing logic would still be executed back on the node where the cluster router is defined, I believe (would love to be wrong above this), which will hinder scalability.This is how I would implement a truly transparent, distributed cluster router, which does satisfy the router credo (feedback more than welcome):- Distribute the cluster router code to different nodes (if you're using the built in one, done already)- Let there be a "master" cluster router node which is responsible for deploying routees and handling dynamic resizing- All of the other copies of the cluster router are slaves and get notified by the master any time the routee list changes- Local actors use the node-local copy of the router, and routing logic always happens concurrently, on the same node, on the same thread, does not hinder scalability
I'm going to implement some version of this. This feels different enough from he current cluster router that it probably should be a new thing, like DistributedClusterRouter.
---EvanCheers,Patrik
--
Evan Chan
Senior Software Engineer |
e...@ooyala.com | (650) 996-4600
www.ooyala.com | blog | @ooyala
--
I'm going to implement some version of this. This feels different enough from he current cluster router that it probably should be a new thing, like DistributedClusterRouter.Great, let us know if you need any assistance, or review./Patrik
Patrik,
On Saturday, October 27, 2012 10:41:49 AM UTC-7, Patrik Nordwall wrote:I'm going to implement some version of this. This feels different enough from he current cluster router that it probably should be a new thing, like DistributedClusterRouter.Great, let us know if you need any assistance, or review./PatrikWhat would help is if we could subscribe to the ClusterRouterConfig and its underlying Actor, anytime it decides to add new routees due to a node joining, or similar events.I was initially thinking of creating a modified underlying cluster router actor, which sends out notifications to slave routers anytime the routee set changes. However, the ability to subscribe to cluster router events would be more flexible. Also, since the underlying cluster router actor code is private[akka], I'd probably have to copy and paste. :-p
Patrik,What are the best practices to follow now so that we can lessen the migration work when the actor tree partitioning stuff is ready?
In the meantime I'll listen for cluster events myself. It does mean re-implementing some of the stuff that's already in the cluster router stuff though, which is too bad.
Also, I understand from the docs that creating actors locally on a node, and making a remote call into a service that creates actors locally, is preferable to remote deploy of an actor. Is that right? It's probably faster too.