Re: [akka-user] In an Akka cluster, can I programmatically discover which node has a particular cluster singleton?

2016-05-17 Thread Steve Rehrauer
Ok, thanks.  I’m not assigning roles for nodes to host singletons, so I’ll go 
with the simpler, “oldest node” method to guess at where mine are.

> On May 17, 2016, at 5:04 PM, Konrad Malawski  
> wrote:
> 
>> (I'm not clear if you have N singletons, that they all reside on the same 
>> node though?)
> 
> Yes, unless you give tell some of them to be on a specific role.
> 
> As seen in 
> http://doc.akka.io/docs/akka/current/scala/cluster-singleton.html#An_Example 
> 
> -- Konrad

-- 
>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] In an Akka cluster, can I programmatically discover which node has a particular cluster singleton?

2016-05-17 Thread Steve Rehrauer
Okay, I was starting to pursue just asking which node in the cluster was
the oldest.  Seems like the singletons ought to migrate to that node?

(I'm not clear if you have N singletons, that they all reside on the same
node though?)


On Tue, May 17, 2016 at 4:47 PM, Justin du coeur  wrote:

> I suspect the most straightforward way to do this is to send a message to
> the singleton and ask it which node it's living on.  Granted, that makes
> the test a bit less black-box...
>
> On Tue, May 17, 2016 at 4:29 PM, Steve Rehrauer 
> wrote:
>
>> I have a few cluster singletons.
>>
>> One in particular can hold a fair bit of state.
>>
>> While doing load-tests, I want a way to discover which node's heap use is
>> contributed to by that singleton.
>>
>> Is there a programmatic way to, from a sequence of the cluster nodes and
>> the singleton's proxy actor reference, discover which of those nodes the
>> singleton resides on?
>>
>> (I'd prefer not to be parsing actor paths to do this.  Was hoping there
>> was an Akka equivalent of node.address for an actor ref for the proxy,
>> something like actor.node.address.)
>>
>> --
>> >>>>>>>>>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> >>>>>>>>>> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/35Y3qNj_4eY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: In an Akka cluster, can I programmatically discover which node has a particular cluster singleton?

2016-05-17 Thread Steve Rehrauer
Nope. :)

On Tuesday, May 17, 2016 at 4:32:29 PM UTC-4, Steve Rehrauer wrote:
>
> Wait, might be as simple as node.address.host == 
> actorRef.path.address.host?
>
>
> On Tuesday, May 17, 2016 at 4:29:53 PM UTC-4, Steve Rehrauer wrote:
>>
>> I have a few cluster singletons.
>>
>> One in particular can hold a fair bit of state.
>>
>> While doing load-tests, I want a way to discover which node's heap use is 
>> contributed to by that singleton.
>>
>> Is there a programmatic way to, from a sequence of the cluster nodes and 
>> the singleton's proxy actor reference, discover which of those nodes the 
>> singleton resides on?
>>
>> (I'd prefer not to be parsing actor paths to do this.  Was hoping there 
>> was an Akka equivalent of node.address for an actor ref for the proxy, 
>> something like actor.node.address.)
>>
>>

-- 
>>>>>>>>>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: In an Akka cluster, can I programmatically discover which node has a particular cluster singleton?

2016-05-17 Thread Steve Rehrauer
Wait, might be as simple as node.address.host == actorRef.path.address.host?


On Tuesday, May 17, 2016 at 4:29:53 PM UTC-4, Steve Rehrauer wrote:
>
> I have a few cluster singletons.
>
> One in particular can hold a fair bit of state.
>
> While doing load-tests, I want a way to discover which node's heap use is 
> contributed to by that singleton.
>
> Is there a programmatic way to, from a sequence of the cluster nodes and 
> the singleton's proxy actor reference, discover which of those nodes the 
> singleton resides on?
>
> (I'd prefer not to be parsing actor paths to do this.  Was hoping there 
> was an Akka equivalent of node.address for an actor ref for the proxy, 
> something like actor.node.address.)
>
>

-- 
>>>>>>>>>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] In an Akka cluster, can I programmatically discover which node has a particular cluster singleton?

2016-05-17 Thread Steve Rehrauer
I have a few cluster singletons.

One in particular can hold a fair bit of state.

While doing load-tests, I want a way to discover which node's heap use is 
contributed to by that singleton.

Is there a programmatic way to, from a sequence of the cluster nodes and 
the singleton's proxy actor reference, discover which of those nodes the 
singleton resides on?

(I'd prefer not to be parsing actor paths to do this.  Was hoping there was 
an Akka equivalent of node.address for an actor ref for the proxy, 
something like actor.node.address.)

-- 
>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Is it possible to put a cluster singleton on a custom dispatcher?

2016-04-25 Thread Steve Rehrauer
If I wanted to declare a PinnedDispatcher for use by a singleton, can I do 
it?

I've tried declaring such a dispatcher in the .conf, and then in an 
akka.deploy section naming the path of the singleton to use that dispatcher.

Either I'm not doing it correctly, or it's being ignored.  It still seems 
to be using the default dispatcher.  Is that expected?  Or is this my 
config error?

Thanks in advance!

-- 
>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: What config affects the number of threads for an ActorSystem?

2016-04-19 Thread Steve Rehrauer
Ahhh, I see.  Thanks for your patience, that helps.


On Tue, Apr 19, 2016 at 10:26 AM, Johan Andrén 
wrote:

> It was more this specific section of the docs I was hoping you'd notice:
>
>
>1. # Configuration for the fork join pool
>2. fork-join-executor {
>3. # Min number of threads to cap factor-based parallelism number to
>4. parallelism-min = 2
>5. # Parallelism (threads) ... ceil(available processors * factor)
>6. parallelism-factor = 2.0
>7. # Max number of threads to cap factor-based parallelism number to
>8. parallelism-max = 10
>9. }
>10.
>
>
> Note how the parallelism-max is a cap, the actual number is calculated by
> multiplying the number of cores with the parallelism-factor and then
> capping it with the min and max to arrive at the actual number on a given
> computer.
>
> The specific number of 50 is hard to say anything concrete about without
> more info, but note that you will have a number of threads in the JVM not
> being dispatcher threads and even some unrelated to Akka. The dispatcher
> threads are easy to recognize as they are named
> "[systemname]-actor.default-dispatcher-[n]".
>
> --
> Johan Andrén
> Akka Team, Lightbend Inc.
>
>
> On Tuesday, April 19, 2016 at 4:16:05 PM UTC+2, Steve Rehrauer wrote:
>>
>> Thanks, Johan.
>>
>> I did see that page, but if I understand the dispatcher config, the actor
>> name you can define can't be a pattern?  We define many actors without
>> simple names like "myActor".  In order to define a dispatcher for these
>> actors, I presume I'd need to make a code change to use that dispatcher
>> when the actors are created?
>>
>> Long term, that's what I'll want to do.  Short term, I was hoping to find
>> a pure config way to fix this.  Would be happy to override the default
>> dispatcher's config, if that were possible, for a short-term fix.
>>
>> --
> >>>>>>>>>> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/m1USxQbXIiM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: What config affects the number of threads for an ActorSystem?

2016-04-19 Thread Steve Rehrauer
Thanks, Johan.

I did see that page, but if I understand the dispatcher config, the actor
name you can define can't be a pattern?  We define many actors without
simple names like "myActor".  In order to define a dispatcher for these
actors, I presume I'd need to make a code change to use that dispatcher
when the actors are created?

Long term, that's what I'll want to do.  Short term, I was hoping to find a
pure config way to fix this.  Would be happy to override the default
dispatcher's config, if that were possible, for a short-term fix.

On Mon, Apr 18, 2016 at 12:08 PM, Johan Andrén 
wrote:

> Hi Steve,
>
> Did you have a look at the docs about dispatcher configuration?
>
> http://doc.akka.io/docs/akka/2.4.2/scala/dispatchers.html#default-dispatcher
>
> --
> Johan Andrén
> Akka Team, Lightbend Inc.
>
>
> On Sunday, April 17, 2016 at 3:29:49 PM UTC+2, Steve Rehrauer wrote:
>>
>> I have an application that doesn't specify a custom dispatcher.
>>
>> We see the number of threads maxing out at 50, and would like to increase
>> it.
>>
>> This doesn't seem to line up with any of the default config I see in
>> Akka?  I see
>>
>>  akka.actor.default-dispatcher.fork-join-executor.parallelism-max = 64
>>
>> and I've tried raising this particular config, but still don't see more
>> than 50 active threads.
>>
>> How can I affect this?
>>
> --
> >>>>>>>>>> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/m1USxQbXIiM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] What config affects the number of threads for an ActorSystem?

2016-04-17 Thread Steve Rehrauer
I have an application that doesn't specify a custom dispatcher.

We see the number of threads maxing out at 50, and would like to increase 
it.

This doesn't seem to line up with any of the default config I see in Akka?  
I see 

 akka.actor.default-dispatcher.fork-join-executor.parallelism-max = 64

and I've tried raising this particular config, but still don't see more 
than 50 active threads.

How can I affect this?

-- 
>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Which is the preferred way to get the current set of cluster nodes?

2015-02-04 Thread Steve Rehrauer
Our clustered app has a cluster singleton actor that constructs a Cluster 
instance, and also subscribes to cluster events.

If you ask it, "What are the current nodes?" it uses cluster.state.members.

I.e., simplified, something like:

  val cluster = Cluster(context.system)

  override def preStart(): Unit =
cluster.subscribe(self, classOf[MemberEvent])
  def receive = {
case state: GetNodes =>
  sender ! cluster.state.members

...
  }


Currently, we just info-log events like MemberUp, MemberDown, etc.

But I see an Akka activator example for listening to cluster state that 
does something like this instead:

  val cluster = Cluster(context.system)
  var nodes = Set.empty[Member]
  override def preStart(): Unit =
cluster.subscribe(self, classOf[MemberEvent])
  def receive = {
 case MemberUp(member) =>
  nodes += member
case MemberRemoved(member, _) =>
  nodes -= member   case state: GetNodes =>
  sender ! nodes

...
  }

Is there a reason not to use the Cluster object's mutable state?  It seems 
to work doing it that way, so I'm wondering whether the activator example 
is doing it this way just to illustrate how to handle some MemberEvents, or 
whether what our app is doing is incorrect or less reliable in some 
circumstances?

-- 
>>  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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.