[akka-user] Akka and Lagom

2016-07-02 Thread Tal Beno
Hi,

As a Scala/Akka novice, was wondering if the new Lagom Scala coding 
paradigm is going to reflect some of the Akka API. in other words, to what 
degree will we need to redesign Akka projects to start using Lagom 
Services. I have taken a look at some of the Lagom Java examples out there, 
and as a novice got the impression that Akka may be under the covers, but 
Actors are not showing up on the surface.

Hope my question makes sense.
Thanks.
Regards,
Tal Beno

-- 
>>  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: Is it possible to increase the number of serialization threads?

2016-07-02 Thread Eduardo Fernandes
Hi Guido.

After implementing your suggestions I'm realizing that maybe my particular
case is a bit peculiar, I'm interested in a benchmark involving 2 hosts.
I'm getting around 500.000 transactions per second (echo of array of 48
bytes), which is not a so bad number. Increasing the number of worker
threads is not improving my numbers. I have two actors in a shard region
talking to other two actors in other shard region (in other physical node).
It looks like Akka/netty, when talking to the second shard region, never
asks for more than one thread when connecting to the second shard region. I
think that Akka could use as many threads as actors in the first shard
region, below a max number. In my case, with a 8 cores machine, we could
expect that, for example, two threads could be used to serialize from host1
to host2 but I'm afraid that is not the case.

Thanks again for your time on this.

Regards.


On Sat, Jul 2, 2016 at 1:35 PM, Guido Medina  wrote:

> The following might also be helpful:
>
>
> akka.remote {
>
>   #log-remote-lifecycle-events = off
>
>   netty.tcp {
>
> #port = 0
>
> server-socket-worker-pool {
>   pool-size-min = 4
>   pool-size-factor = 1
>   pool-size-max = 8
> }
>
> client-socket-worker-pool {
>   pool-size-min = 4
>   pool-size-factor = 1
>   pool-size-max = 8
> }
>   }
> }
>
>
>
>
> On Saturday, July 2, 2016 at 12:31:12 PM UTC+1, Guido Medina wrote:
>>
>> Didn't read the serialization part, must be that I need my coffee, Kryo
>> is very well optimized, you don't know if is going to help until you test
>> it.
>> Kryo also also has a pool of serializers that are ready to be used and
>> can be improved if you declared the classes you are serializing.
>>
>> On Saturday, July 2, 2016 at 12:27:28 PM UTC+1, Guido Medina wrote:
>>>
>>> Try the following, these values work great,
>>> you can try higher but I don't think it is going to help because the
>>> most of the bottleneck is because of design,
>>> a problem related with how akka-remote is designed around Netty, but
>>> that will change soon: https://github.com/akka/akka-meta/issues/22
>>>
>>> akka.remote.default-remote-dispatcher {
>>>   type = Dispatcher
>>>   executor = "fork-join-executor"
>>>
>>>   fork-join-executor {
>>> parallelism-min = 4
>>> parallelism-factor = 1
>>> parallelism-max = 8
>>>   }
>>> }
>>>
>>> Also, what serialization are you using? Hopefully is the not default
>>> Java serialization, most people use Kryo serialization.
>>>
>>> Non-related but could help:
>>>
>>>- Set Akka version to "2.3.15" (next week 2.3.16 is probably going
>>>to be released)
>>>- Set Netty version to "3.10.6.Final" which will be part of next
>>>release.
>>>
>>> See https://github.com/netty/netty/issues?q=milestone%3A3.10.6.Final
>>> and https://github.com/akka/akka/pull/20857
>>>
>>> HTH,
>>>
>>> Guido.
>>>
>>> On Saturday, July 2, 2016 at 12:14:24 AM UTC+1, Eduardo Fernandes wrote:

 Hi.

 I'm using Akka 2.3.13, Java edition.

 I'm making some performance tests and in the same machine with 8 cores
 I see that the serialization process is my bottleneck.  I know that because
 after an increment of actor cpu usage the throughput is exactly the same.

 My actor system talks to 2 other nodes so I see 2 cores dedicated to
 serialization. Is is possible to increase the number of threads for
 serialization?

 I'm using standard Java serialization but I have my own serialization
 implementation in my write/readObject methods so I think that switching to
 kryo or similar will not enhance too much the throughput.

 Many thanks for your help.

 /Eduardo

 --
> >> 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/EVsIxMEDKeI/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, 

Re: [akka-user] Is it possible to increase the number of serialization threads?

2016-07-02 Thread Eduardo Fernandes
Hi Viktor.

I'm using basic (binary) serialization of basic Java types (int, String
(UTF), long, arrays of basic types, etc...).

The overhead is that depending of internal values there is no send to
serialize some members and other not. If you merge your functional logic
with the serialization you can make optimizations that a generic serializar
can't do. Example. Suppose that if a member A has a null value you don't
have to serialize other member B. Maybe the member B you don't have to
serialize could have a null value which is fast to serialize but it is even
faster you don't have even to serialize the null. This type of overhead is
only possible if the serializer knows about your functional logic.

Regards

On Sat, Jul 2, 2016 at 10:05 PM, Viktor Klang 
wrote:

> Hi Eduardo,
>
> Perhaps I misunderstood, what serialization format are you emitting in
> your readObject/writeObject?
> What overhead are you observing compared to using a custom Serializer?
>
> On Sat, Jul 2, 2016 at 10:02 PM, Eduardo Fernandes 
> wrote:
>
>> Hi.
>>
>> If you have writeObject/readObject defined in your class the Java plain
>> serialization will invoke those methods. In my case all my internal members
>> and class references are also serialized using the very same technique. So
>> this is equivalent to technologies like kryo and similars since there is no
>> overhead if you serialize basic members. In other words the pre-compiles
>> classes you get from kryo are already made so there is no performance
>> enhancement in this case. The big advantage of kryo is that you don't have
>> to create the writeObject/readObject by yourself. In my particular case
>> I've already done that job and my serialization is optimized in particular
>> cases where I don't have to serialize all members depending of my semantic.
>> I've made some tests and doing this way is faster than kryo but you have to
>> burn some calories implementing a optimized serialization code.
>>
>> Bests regards and thanks for your comment.
>>
>>
>> On Sat, Jul 2, 2016 at 9:27 PM, Viktor Klang 
>> wrote:
>>
>>> I'm not sure I understand why write/readObject special methods would
>>> necessarily be faster? Most of the waste of Java Serialization is its
>>> envelopes and using class names etc.
>>>
>>> On Sat, Jul 2, 2016 at 1:14 AM, Eduardo Fernandes 
>>> wrote:
>>>
 Hi.

 I'm using Akka 2.3.13, Java edition.

 I'm making some performance tests and in the same machine with 8 cores
 I see that the serialization process is my bottleneck.  I know that because
 after an increment of actor cpu usage the throughput is exactly the same.

 My actor system talks to 2 other nodes so I see 2 cores dedicated to
 serialization. Is is possible to increase the number of threads for
 serialization?

 I'm using standard Java serialization but I have my own serialization
 implementation in my write/readObject methods so I think that switching to
 kryo or similar will not enhance too much the throughput.

 Many thanks for your help.

 /Eduardo

 --
 >> 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.

>>>
>>>
>>>
>>> --
>>> Cheers,
>>> √
>>>
>>> --
>>> >> 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/EVsIxMEDKeI/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 

Re: [akka-user] Is it possible to increase the number of serialization threads?

2016-07-02 Thread Viktor Klang
Hi Eduardo,

Perhaps I misunderstood, what serialization format are you emitting in your
readObject/writeObject?
What overhead are you observing compared to using a custom Serializer?

On Sat, Jul 2, 2016 at 10:02 PM, Eduardo Fernandes  wrote:

> Hi.
>
> If you have writeObject/readObject defined in your class the Java plain
> serialization will invoke those methods. In my case all my internal members
> and class references are also serialized using the very same technique. So
> this is equivalent to technologies like kryo and similars since there is no
> overhead if you serialize basic members. In other words the pre-compiles
> classes you get from kryo are already made so there is no performance
> enhancement in this case. The big advantage of kryo is that you don't have
> to create the writeObject/readObject by yourself. In my particular case
> I've already done that job and my serialization is optimized in particular
> cases where I don't have to serialize all members depending of my semantic.
> I've made some tests and doing this way is faster than kryo but you have to
> burn some calories implementing a optimized serialization code.
>
> Bests regards and thanks for your comment.
>
>
> On Sat, Jul 2, 2016 at 9:27 PM, Viktor Klang 
> wrote:
>
>> I'm not sure I understand why write/readObject special methods would
>> necessarily be faster? Most of the waste of Java Serialization is its
>> envelopes and using class names etc.
>>
>> On Sat, Jul 2, 2016 at 1:14 AM, Eduardo Fernandes 
>> wrote:
>>
>>> Hi.
>>>
>>> I'm using Akka 2.3.13, Java edition.
>>>
>>> I'm making some performance tests and in the same machine with 8 cores I
>>> see that the serialization process is my bottleneck.  I know that because
>>> after an increment of actor cpu usage the throughput is exactly the same.
>>>
>>> My actor system talks to 2 other nodes so I see 2 cores dedicated to
>>> serialization. Is is possible to increase the number of threads for
>>> serialization?
>>>
>>> I'm using standard Java serialization but I have my own serialization
>>> implementation in my write/readObject methods so I think that switching to
>>> kryo or similar will not enhance too much the throughput.
>>>
>>> Many thanks for your help.
>>>
>>> /Eduardo
>>>
>>> --
>>> >> 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.
>>>
>>
>>
>>
>> --
>> Cheers,
>> √
>>
>> --
>> >> 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/EVsIxMEDKeI/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.
>



-- 
Cheers,
√

-- 
>>  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.

Re: [akka-user] Is it possible to increase the number of serialization threads?

2016-07-02 Thread Eduardo Fernandes
Hi.

If you have writeObject/readObject defined in your class the Java plain
serialization will invoke those methods. In my case all my internal members
and class references are also serialized using the very same technique. So
this is equivalent to technologies like kryo and similars since there is no
overhead if you serialize basic members. In other words the pre-compiles
classes you get from kryo are already made so there is no performance
enhancement in this case. The big advantage of kryo is that you don't have
to create the writeObject/readObject by yourself. In my particular case
I've already done that job and my serialization is optimized in particular
cases where I don't have to serialize all members depending of my semantic.
I've made some tests and doing this way is faster than kryo but you have to
burn some calories implementing a optimized serialization code.

Bests regards and thanks for your comment.


On Sat, Jul 2, 2016 at 9:27 PM, Viktor Klang  wrote:

> I'm not sure I understand why write/readObject special methods would
> necessarily be faster? Most of the waste of Java Serialization is its
> envelopes and using class names etc.
>
> On Sat, Jul 2, 2016 at 1:14 AM, Eduardo Fernandes 
> wrote:
>
>> Hi.
>>
>> I'm using Akka 2.3.13, Java edition.
>>
>> I'm making some performance tests and in the same machine with 8 cores I
>> see that the serialization process is my bottleneck.  I know that because
>> after an increment of actor cpu usage the throughput is exactly the same.
>>
>> My actor system talks to 2 other nodes so I see 2 cores dedicated to
>> serialization. Is is possible to increase the number of threads for
>> serialization?
>>
>> I'm using standard Java serialization but I have my own serialization
>> implementation in my write/readObject methods so I think that switching to
>> kryo or similar will not enhance too much the throughput.
>>
>> Many thanks for your help.
>>
>> /Eduardo
>>
>> --
>> >> 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.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> 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/EVsIxMEDKeI/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] Is it possible to increase the number of serialization threads?

2016-07-02 Thread Viktor Klang
I'm not sure I understand why write/readObject special methods would
necessarily be faster? Most of the waste of Java Serialization is its
envelopes and using class names etc.

On Sat, Jul 2, 2016 at 1:14 AM, Eduardo Fernandes  wrote:

> Hi.
>
> I'm using Akka 2.3.13, Java edition.
>
> I'm making some performance tests and in the same machine with 8 cores I
> see that the serialization process is my bottleneck.  I know that because
> after an increment of actor cpu usage the throughput is exactly the same.
>
> My actor system talks to 2 other nodes so I see 2 cores dedicated to
> serialization. Is is possible to increase the number of threads for
> serialization?
>
> I'm using standard Java serialization but I have my own serialization
> implementation in my write/readObject methods so I think that switching to
> kryo or similar will not enhance too much the throughput.
>
> Many thanks for your help.
>
> /Eduardo
>
> --
> >> 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.
>



-- 
Cheers,
√

-- 
>>  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] How to find Oldest node in Akka Cluster Singleton

2016-07-02 Thread Madabhattula Rajesh Kumar
Hi,

In  akka cluster singleton how to find "Oldest" node details.

Regards,
Rajesh

-- 
>>  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: Is it possible to increase the number of serialization threads?

2016-07-02 Thread Eduardo Fernandes
Hi. 

Many thanks for your suggestions. 

I will try and let you know. 

Thanks again for your time. 

> El 2 jul 2016, a las 13:35, Guido Medina  escribió:
> 
> The following might also be helpful:
> 
> 
> akka.remote {
> 
>   #log-remote-lifecycle-events = off
> 
>   netty.tcp {
> 
> #port = 0
> 
> server-socket-worker-pool {
>   pool-size-min = 4
>   pool-size-factor = 1
>   pool-size-max = 8
> }
> 
> client-socket-worker-pool {
>   pool-size-min = 4
>   pool-size-factor = 1
>   pool-size-max = 8
> }
>   }
> }
> 
> 
> 
> 
>> On Saturday, July 2, 2016 at 12:31:12 PM UTC+1, Guido Medina wrote:
>> Didn't read the serialization part, must be that I need my coffee, Kryo is 
>> very well optimized, you don't know if is going to help until you test it.
>> Kryo also also has a pool of serializers that are ready to be used and can 
>> be improved if you declared the classes you are serializing.
>> 
>>> On Saturday, July 2, 2016 at 12:27:28 PM UTC+1, Guido Medina wrote:
>>> Try the following, these values work great,
>>> you can try higher but I don't think it is going to help because the most 
>>> of the bottleneck is because of design,
>>> a problem related with how akka-remote is designed around Netty, but that 
>>> will change soon: https://github.com/akka/akka-meta/issues/22
>>> 
>>> akka.remote.default-remote-dispatcher {
>>>   type = Dispatcher
>>>   executor = "fork-join-executor"
>>> 
>>>   fork-join-executor {
>>> parallelism-min = 4
>>> parallelism-factor = 1
>>> parallelism-max = 8
>>>   }
>>> }
>>> 
>>> Also, what serialization are you using? Hopefully is the not default Java 
>>> serialization, most people use Kryo serialization.
>>> 
>>> Non-related but could help:
>>> Set Akka version to "2.3.15" (next week 2.3.16 is probably going to be 
>>> released)
>>> Set Netty version to "3.10.6.Final" which will be part of next release.
>>> See https://github.com/netty/netty/issues?q=milestone%3A3.10.6.Final and 
>>> https://github.com/akka/akka/pull/20857
>>> 
>>> HTH,
>>> 
>>> Guido.
>>> 
 On Saturday, July 2, 2016 at 12:14:24 AM UTC+1, Eduardo Fernandes wrote:
 Hi.
 
 I'm using Akka 2.3.13, Java edition.
 
 I'm making some performance tests and in the same machine with 8 cores I 
 see that the serialization process is my bottleneck.  I know that because 
 after an increment of actor cpu usage the throughput is exactly the same. 
 
 My actor system talks to 2 other nodes so I see 2 cores dedicated to 
 serialization. Is is possible to increase the number of threads for 
 serialization?
 
 I'm using standard Java serialization but I have my own serialization 
 implementation in my write/readObject methods so I think that switching to 
 kryo or similar will not enhance too much the throughput. 
 
 Many thanks for your help.
 
 /Eduardo
> 
> -- 
> >> 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/EVsIxMEDKeI/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: Is it possible to increase the number of serialization threads?

2016-07-02 Thread Guido Medina
The following might also be helpful:


akka.remote {

  #log-remote-lifecycle-events = off

  netty.tcp {

#port = 0

server-socket-worker-pool {
  pool-size-min = 4
  pool-size-factor = 1
  pool-size-max = 8
}

client-socket-worker-pool {
  pool-size-min = 4
  pool-size-factor = 1
  pool-size-max = 8
}
  }
}




On Saturday, July 2, 2016 at 12:31:12 PM UTC+1, Guido Medina wrote:
>
> Didn't read the serialization part, must be that I need my coffee, Kryo is 
> very well optimized, you don't know if is going to help until you test it.
> Kryo also also has a pool of serializers that are ready to be used and can 
> be improved if you declared the classes you are serializing.
>
> On Saturday, July 2, 2016 at 12:27:28 PM UTC+1, Guido Medina wrote:
>>
>> Try the following, these values work great,
>> you can try higher but I don't think it is going to help because the most 
>> of the bottleneck is because of design,
>> a problem related with how akka-remote is designed around Netty, but that 
>> will change soon: https://github.com/akka/akka-meta/issues/22
>>
>> akka.remote.default-remote-dispatcher {
>>   type = Dispatcher
>>   executor = "fork-join-executor"
>>
>>   fork-join-executor {
>> parallelism-min = 4
>> parallelism-factor = 1
>> parallelism-max = 8
>>   }
>> }
>>
>> Also, what serialization are you using? Hopefully is the not default Java 
>> serialization, most people use Kryo serialization.
>>
>> Non-related but could help:
>>
>>- Set Akka version to "2.3.15" (next week 2.3.16 is probably going to 
>>be released)
>>- Set Netty version to "3.10.6.Final" which will be part of next 
>>release.
>>
>> See https://github.com/netty/netty/issues?q=milestone%3A3.10.6.Final and 
>> https://github.com/akka/akka/pull/20857
>>
>> HTH,
>>
>> Guido.
>>
>> On Saturday, July 2, 2016 at 12:14:24 AM UTC+1, Eduardo Fernandes wrote:
>>>
>>> Hi.
>>>
>>> I'm using Akka 2.3.13, Java edition.
>>>
>>> I'm making some performance tests and in the same machine with 8 cores I 
>>> see that the serialization process is my bottleneck.  I know that because 
>>> after an increment of actor cpu usage the throughput is exactly the same. 
>>>
>>> My actor system talks to 2 other nodes so I see 2 cores dedicated to 
>>> serialization. Is is possible to increase the number of threads for 
>>> serialization?
>>>
>>> I'm using standard Java serialization but I have my own serialization 
>>> implementation in my write/readObject methods so I think that switching to 
>>> kryo or similar will not enhance too much the throughput. 
>>>
>>> Many thanks for your help.
>>>
>>> /Eduardo
>>>
>>>

-- 
>>  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: Is it possible to increase the number of serialization threads?

2016-07-02 Thread Guido Medina
Didn't read the serialization part, must be that I need my coffee, Kryo is 
very well optimized, you don't know if is going to help until you test it.
Kryo also also has a pool of serializers that are ready to be used and can 
be improved if you declared the classes you are serializing.

On Saturday, July 2, 2016 at 12:27:28 PM UTC+1, Guido Medina wrote:
>
> Try the following, these values work great,
> you can try higher but I don't think it is going to help because the most 
> of the bottleneck is because of design,
> a problem related with how akka-remote is designed around Netty, but that 
> will change soon: https://github.com/akka/akka-meta/issues/22
>
> akka.remote.default-remote-dispatcher {
>   type = Dispatcher
>   executor = "fork-join-executor"
>
>   fork-join-executor {
> parallelism-min = 4
> parallelism-factor = 1
> parallelism-max = 8
>   }
> }
>
> Also, what serialization are you using? Hopefully is the not default Java 
> serialization, most people use Kryo serialization.
>
> Non-related but could help:
>
>- Set Akka version to "2.3.15" (next week 2.3.16 is probably going to 
>be released)
>- Set Netty version to "3.10.6.Final" which will be part of next 
>release.
>
> See https://github.com/netty/netty/issues?q=milestone%3A3.10.6.Final and 
> https://github.com/akka/akka/pull/20857
>
> HTH,
>
> Guido.
>
> On Saturday, July 2, 2016 at 12:14:24 AM UTC+1, Eduardo Fernandes wrote:
>>
>> Hi.
>>
>> I'm using Akka 2.3.13, Java edition.
>>
>> I'm making some performance tests and in the same machine with 8 cores I 
>> see that the serialization process is my bottleneck.  I know that because 
>> after an increment of actor cpu usage the throughput is exactly the same. 
>>
>> My actor system talks to 2 other nodes so I see 2 cores dedicated to 
>> serialization. Is is possible to increase the number of threads for 
>> serialization?
>>
>> I'm using standard Java serialization but I have my own serialization 
>> implementation in my write/readObject methods so I think that switching to 
>> kryo or similar will not enhance too much the throughput. 
>>
>> Many thanks for your help.
>>
>> /Eduardo
>>
>>

-- 
>>  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] Akk Cluster Singletion - Oldest node down message

2016-07-02 Thread Madabhattula Rajesh Kumar
Hi,

In Akka Cluster Singleton how worker(younger) node receive a message when 
Cluster Singleton node(Oldest) was down ?

In Akka *younger* node I am seeing below WARN message

*[WARN] [07/02/2016 00:32:55.720] 
[ClusterSystem-akka.actor.default-dispatcher-2] 
[akka.tcp://ClusterSystem@hostname1:2551/system/cluster/core/daemon] 
Cluster Node [akka.tcp://ClusterSystem@hostname1:2551] - Marking node(s) as 
UNREACHABLE [Member(address = akka.tcp://ClusterSystem@hostname2:2552, 
status = Up)]. Node roles []*

How to receive this event from younger node.


Regards,
Rajesh

-- 
>>  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: Is it possible to increase the number of serialization threads?

2016-07-02 Thread Guido Medina
Try the following, these values work great,
you can try higher but I don't think it is going to help because the most 
of the bottleneck is because of design,
a problem related with how akka-remote is designed around Netty, but that 
will change soon: https://github.com/akka/akka-meta/issues/22

akka.remote.default-remote-dispatcher {
  type = Dispatcher
  executor = "fork-join-executor"

  fork-join-executor {
parallelism-min = 4
parallelism-factor = 1
parallelism-max = 8
  }
}

Also, what serialization are you using? Hopefully is the not default Java 
serialization, most people use Kryo serialization.

Non-related but could help:

   - Set Akka version to "2.3.15" (next week 2.3.16 is probably going to be 
   released)
   - Set Netty version to "3.10.6.Final" which will be part of next release.

See https://github.com/netty/netty/issues?q=milestone%3A3.10.6.Final 
and https://github.com/akka/akka/pull/20857

HTH,

Guido.

On Saturday, July 2, 2016 at 12:14:24 AM UTC+1, Eduardo Fernandes wrote:
>
> Hi.
>
> I'm using Akka 2.3.13, Java edition.
>
> I'm making some performance tests and in the same machine with 8 cores I 
> see that the serialization process is my bottleneck.  I know that because 
> after an increment of actor cpu usage the throughput is exactly the same. 
>
> My actor system talks to 2 other nodes so I see 2 cores dedicated to 
> serialization. Is is possible to increase the number of threads for 
> serialization?
>
> I'm using standard Java serialization but I have my own serialization 
> implementation in my write/readObject methods so I think that switching to 
> kryo or similar will not enhance too much the throughput. 
>
> Many thanks for your help.
>
> /Eduardo
>
>

-- 
>>  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] PersistenceQuery: Materialize view to datastore - When should the query stream be stopped?

2016-07-02 Thread Giovanni Alberto Caporaletti
Talking about the pattern in the subject 
:
 I 
can't find a clean way of managing the lifecycle of persistence query 
streams that save persisted events to a read datastore (but they could do 
anything else as far as we're concerned)

The problem is: persistent entities often have a lifecycle. They are 
created, passivated (could be sharded), and they can be woken up 
again/replayed.

Let's make an example: say we are managing users, and our aggregate root is 
a "User" actor. We could have 100 million users (yay) but only 100k active 
concurrently. 
We don't want to keep everything up and running in our cluster - especially 
old, inactive users - so we passivate the instances after inactivity, or 
when they are "disabled" from the admin or when they deregister or for 
whatever reason.

Let's now say we have a persistence query that publishes for each user (via 
its persistenceId) all the events to a read datastore (i.e. 
UserEmailConfirmed, UserNameUpdated, UserLoggedIn, whatever, etc). It 
starts when the user starts, and then it goes on decoupled. How can I avoid 
keeping in memory all the streams for all the users ever started? Since the 
user has a lifecycle, the persistence query has too, when do I stop/restart 
it?

I thought of different things, most of which I don't like:

   1.  Have special events to signal the termination of the actor so that 
   when the query stream gets it, it stops. This would poison the domain model 
   with something completely irrelevant to it
   2.  Have a "manager" actor that starts the persistent entity and the 
   persistence query at the same time, watches the entity and stops the stream 
   using a killswitch when the parent terminates (after a delay, because the 
   last few events could not have bene processed yet from the decoupled query, 
   because of polling or backpressure). This is unreliable and really bad from 
   a design point of view.
   3. Tagging events and have a single stream: not feasible on a cluster 
   because we would have the same events on all nodes
   4. (Had this idea just now) Tag events with a sort of sharding id, so 
   that we have like 100 tags and 100 streams persistently running, 
   distributed over the cluster (e.g. from actors sharded using the same 
   sharding id/tag)


Since this is a use case so common that it's in the akka documentation 
,
 
what's the best practice? It would be nice to have a discussion here and 
then add the results (if any) to the documentation. For now, it just says 
how to start queries, not how/when to stop them w.r.t the lifecycle of our 
aggregate root/entity.
I think this is particularly relevant in the case of sharded persistent 
entities, or in general when we have a big number of aggregate roots (e.g. 
an "order" for an e-commerce site)


Let me know what you think!

Cheers
G

-- 
>>  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.