Re: [akka-user] Re: Akka http vs Spray performance

2016-10-06 Thread Olga Gorun
For more information, I give here versions I test with.

ubuntu 14.04, scala 2.11.8, oracle jdk 1.8

akka-http: 2.4.11

spray: 1.3.1 with akka 2.3.6

On Thursday, October 6, 2016 at 10:26:48 PM UTC+3, Olga Gorun wrote:
>
> Hi Christian. Thank you for response. I checked that equal Xms/Xmx both 
> set to more than enough memory (4GB while used heap is not more than 1.5GB 
> during load test with or without  explicitly defined memory) don't 
> influence results. I'll try other JVM settings you propose. But generally 
> speaking I don't understand why I should see something different in GC 
> behavior. String used as response defined as val in object. It's not 
> created in some class instantiated per request. So GC should not clear it. 
> When GC should make more work if response length is increased?
>
> On Thursday, October 6, 2016 at 10:03:47 PM UTC+3, Christian Schmitt wrote:
>>
>> garbadge collection I guess. also I didn't see if you've set Xms/Xmx you 
>> should set them equal. And also try the following: -XX:+UseNUMA 
>> -XX:+UseG1GC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem 
>> -XX:+ParallelRefProcEnabled paramters, not all of them will be helpful, but 
>> you should try some of them.
>>
>> Am Donnerstag, 6. Oktober 2016 18:08:57 UTC+2 schrieb Olga Gorun:
>>>
>>> I continue playing with given example projects and see strange results. 
>>> If I increase string length of static response from 7 to 2490 characters 
>>> throughput is reduced to ~24K rps for both spray and akka-http. 
>>> Does anybody else see such results? How can they be explained? 
>>>
>>>
>>>
>>> On Wednesday, October 5, 2016 at 8:47:54 AM UTC+3, rkuhn wrote:

 Hi Olga,

 establishing a connection is a very expensive operation, which is why 
 all modern clients/browsers reuse them for multiple requests. The ab tool 
 needs the -k switch to enable this behavior.

 Regards, Roland 

 Sent from my iPhone

 On 5 Oct 2016, at 01:32, Olga Gorun  wrote:


 I tried to repeat this benchmark and would be glad to see comments to 
 results I got.  
 Tested porjects: gists from original post with the following versions: 

 akka-http, 2.4.11 vs spray, 1.3.1 (akka - 2.3.6). In both cases scala 
 2.11.8, jvm 8.

 The tests were done on AWS machine of c4.2xlarge type (8 cores CPU, 
 16GB memory, ulimit - 50). As I can see from jvm and system 
 monitoring, 
 it is far from being limited by CPU, memory, disk IO or networking. OS: 
 Ubuntu 14.04

 See results at: 
 https://docs.google.com/spreadsheets/d/1yuFD7WDOzhWB5_Ob7XgAfFAdWt48SrthbvZSZ45GE-k/edit?usp=sharing

 Starting from the fact that my results are different (spray gives 
 better results than akka-http). In addition I see interesting effects when 
 I use different benchmark tools. I also started from wrk, but in addition 
 to throughput I wanted to see failures if exist, and latency percentiles, 
 so I added  tests with weighttp and ab. 

 Throughput reported by ab is much different than the rest and shows 
 drastic difference between akka-http and spray. Reported latency also 
 don't 
 have much in common. I can think that ab (as a single-threaded tool) can 
 be 
 bottleneck itself. But how to explain such a difference in throughput for 
 akka-htttp and spray? And how to explain difference in reported latency.

 Regards,
 Olga Gorun





 -- 
 >> 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.
 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: Akka http vs Spray performance

2016-10-06 Thread Olga Gorun
Hi Christian. Thank you for response. I checked that equal Xms/Xmx both set 
to more than enough memory (4GB while used heap is not more than 1.5GB 
during load test with or without  explicitly defined memory) don't 
influence results. I'll try other JVM settings you propose. But generally 
speaking I don't understand why I should see something different in GC 
behavior. String used as response defined as val in object. It's not 
created in some class instantiated per request. So GC should not clear it. 
When GC should make more work if response length is increased?

On Thursday, October 6, 2016 at 10:03:47 PM UTC+3, Christian Schmitt wrote:
>
> garbadge collection I guess. also I didn't see if you've set Xms/Xmx you 
> should set them equal. And also try the following: -XX:+UseNUMA 
> -XX:+UseG1GC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem 
> -XX:+ParallelRefProcEnabled paramters, not all of them will be helpful, but 
> you should try some of them.
>
> Am Donnerstag, 6. Oktober 2016 18:08:57 UTC+2 schrieb Olga Gorun:
>>
>> I continue playing with given example projects and see strange results. 
>> If I increase string length of static response from 7 to 2490 characters 
>> throughput is reduced to ~24K rps for both spray and akka-http. 
>> Does anybody else see such results? How can they be explained? 
>>
>>
>>
>> On Wednesday, October 5, 2016 at 8:47:54 AM UTC+3, rkuhn wrote:
>>>
>>> Hi Olga,
>>>
>>> establishing a connection is a very expensive operation, which is why 
>>> all modern clients/browsers reuse them for multiple requests. The ab tool 
>>> needs the -k switch to enable this behavior.
>>>
>>> Regards, Roland 
>>>
>>> Sent from my iPhone
>>>
>>> On 5 Oct 2016, at 01:32, Olga Gorun  wrote:
>>>
>>>
>>> I tried to repeat this benchmark and would be glad to see comments to 
>>> results I got.  
>>> Tested porjects: gists from original post with the following versions: 
>>>
>>> akka-http, 2.4.11 vs spray, 1.3.1 (akka - 2.3.6). In both cases scala 
>>> 2.11.8, jvm 8.
>>>
>>> The tests were done on AWS machine of c4.2xlarge type (8 cores CPU, 16GB 
>>> memory, ulimit - 50). As I can see from jvm and system monitoring, it 
>>> is far from being limited by CPU, memory, disk IO or networking. OS: Ubuntu 
>>> 14.04
>>>
>>> See results at: 
>>> https://docs.google.com/spreadsheets/d/1yuFD7WDOzhWB5_Ob7XgAfFAdWt48SrthbvZSZ45GE-k/edit?usp=sharing
>>>
>>> Starting from the fact that my results are different (spray gives better 
>>> results than akka-http). In addition I see interesting effects when I use 
>>> different benchmark tools. I also started from wrk, but in addition to 
>>> throughput I wanted to see failures if exist, and latency percentiles, so I 
>>> added  tests with weighttp and ab. 
>>>
>>> Throughput reported by ab is much different than the rest and shows 
>>> drastic difference between akka-http and spray. Reported latency also don't 
>>> have much in common. I can think that ab (as a single-threaded tool) can be 
>>> bottleneck itself. But how to explain such a difference in throughput for 
>>> akka-htttp and spray? And how to explain difference in reported latency.
>>>
>>> Regards,
>>> Olga Gorun
>>>
>>>
>>>
>>>
>>>
>>> -- 
>>> >> 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.
>>> 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: Akka http vs Spray performance

2016-10-06 Thread Christian Schmitt
garbadge collection I guess. also I didn't see if you've set Xms/Xmx you 
should set them equal. And also try the following: -XX:+UseNUMA 
-XX:+UseG1GC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem 
-XX:+ParallelRefProcEnabled paramters, not all of them will be helpful, but 
you should try some of them.

Am Donnerstag, 6. Oktober 2016 18:08:57 UTC+2 schrieb Olga Gorun:
>
> I continue playing with given example projects and see strange results. If 
> I increase string length of static response from 7 to 2490 characters 
> throughput is reduced to ~24K rps for both spray and akka-http. 
> Does anybody else see such results? How can they be explained? 
>
>
>
> On Wednesday, October 5, 2016 at 8:47:54 AM UTC+3, rkuhn wrote:
>>
>> Hi Olga,
>>
>> establishing a connection is a very expensive operation, which is why all 
>> modern clients/browsers reuse them for multiple requests. The ab tool needs 
>> the -k switch to enable this behavior.
>>
>> Regards, Roland 
>>
>> Sent from my iPhone
>>
>> On 5 Oct 2016, at 01:32, Olga Gorun  wrote:
>>
>>
>> I tried to repeat this benchmark and would be glad to see comments to 
>> results I got.  
>> Tested porjects: gists from original post with the following versions: 
>>
>> akka-http, 2.4.11 vs spray, 1.3.1 (akka - 2.3.6). In both cases scala 
>> 2.11.8, jvm 8.
>>
>> The tests were done on AWS machine of c4.2xlarge type (8 cores CPU, 16GB 
>> memory, ulimit - 50). As I can see from jvm and system monitoring, it 
>> is far from being limited by CPU, memory, disk IO or networking. OS: Ubuntu 
>> 14.04
>>
>> See results at: 
>> https://docs.google.com/spreadsheets/d/1yuFD7WDOzhWB5_Ob7XgAfFAdWt48SrthbvZSZ45GE-k/edit?usp=sharing
>>
>> Starting from the fact that my results are different (spray gives better 
>> results than akka-http). In addition I see interesting effects when I use 
>> different benchmark tools. I also started from wrk, but in addition to 
>> throughput I wanted to see failures if exist, and latency percentiles, so I 
>> added  tests with weighttp and ab. 
>>
>> Throughput reported by ab is much different than the rest and shows 
>> drastic difference between akka-http and spray. Reported latency also don't 
>> have much in common. I can think that ab (as a single-threaded tool) can be 
>> bottleneck itself. But how to explain such a difference in throughput for 
>> akka-htttp and spray? And how to explain difference in reported latency.
>>
>> Regards,
>> Olga Gorun
>>
>>
>>
>>
>>
>> -- 
>> >> 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.
>> 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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
happy hakking!

On Thu, Oct 6, 2016 at 6:19 PM, Alexander Lukyanchikov <
alexanderlukyanchi...@gmail.com> wrote:

> Yes, it is. Now it's clear. Thank you.
>
> On Thursday, October 6, 2016 at 6:04:22 PM UTC+3, √ wrote:
>>
>> My guess is that your default dispatcher has ~30 threads
>>
>> --
>> Cheers,
>> √
>>
>> On Oct 6, 2016 10:03, "Viktor Klang"  wrote:
>>
>>> Of course it builds up if you can't process the messages equal-or-faster
>>> than you get them?
>>>
>>> --
>>> Cheers,
>>> √
>>>
>>> On Oct 6, 2016 09:49, "Alexander Lukyanchikov" 
>>> wrote:
>>>

 Sorry guys, quick update:

 Time interval actually affects the situation: if actor job time <
 scheduler interval, everything is good, no matter how many actors we have.

 When actor job time > scheduler interval and ACTOR_COUNT < 30,
 envelopes filling up and not garbage collected (millions of them after a
 few hours).
 *But if I increase ACTOR_COUNT up to 30, GC starts to delete those
 not-delivered messages, according to the profiler.*

 Why? Looks like something in Akka starts working differently after that
 magic threshold.

 Any ideas?


 --
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: http://doc.akka.io/docs/akka/c
 urrent/additional/faq.html
 >> Search the archives: https://groups.google.com/grou
 p/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.
 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.
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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Alexander Lukyanchikov
Yes, it is. Now it's clear. Thank you.

On Thursday, October 6, 2016 at 6:04:22 PM UTC+3, √ wrote:
>
> My guess is that your default dispatcher has ~30 threads
>
> -- 
> Cheers,
> √
>
> On Oct 6, 2016 10:03, "Viktor Klang"  
> wrote:
>
>> Of course it builds up if you can't process the messages equal-or-faster 
>> than you get them?
>>
>> -- 
>> Cheers,
>> √
>>
>> On Oct 6, 2016 09:49, "Alexander Lukyanchikov" > > wrote:
>>
>>>
>>> Sorry guys, quick update:
>>>
>>> Time interval actually affects the situation: if actor job time < 
>>> scheduler interval, everything is good, no matter how many actors we have.
>>>
>>> When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes 
>>> filling up and not garbage collected (millions of them after a few hours).
>>> *But if I increase ACTOR_COUNT up to 30, GC starts to delete those 
>>> not-delivered messages, according to the profiler.*
>>>
>>> Why? Looks like something in Akka starts working differently after that 
>>> magic threshold.
>>>
>>> Any ideas?
>>>  
>>>
>>> -- 
>>> >> 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 
>>> .
>>> 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: Akka http vs Spray performance

2016-10-06 Thread Olga Gorun
I continue playing with given example projects and see strange results. If 
I increase string length of static response from 7 to 2490 characters 
throughput is reduced to ~24K rps for both spray and akka-http. 
Does anybody else see such results? How can they be explained? 



On Wednesday, October 5, 2016 at 8:47:54 AM UTC+3, rkuhn wrote:
>
> Hi Olga,
>
> establishing a connection is a very expensive operation, which is why all 
> modern clients/browsers reuse them for multiple requests. The ab tool needs 
> the -k switch to enable this behavior.
>
> Regards, Roland 
>
> Sent from my iPhone
>
> On 5 Oct 2016, at 01:32, Olga Gorun  
> wrote:
>
>
> I tried to repeat this benchmark and would be glad to see comments to 
> results I got.  
> Tested porjects: gists from original post with the following versions: 
>
> akka-http, 2.4.11 vs spray, 1.3.1 (akka - 2.3.6). In both cases scala 
> 2.11.8, jvm 8.
>
> The tests were done on AWS machine of c4.2xlarge type (8 cores CPU, 16GB 
> memory, ulimit - 50). As I can see from jvm and system monitoring, it 
> is far from being limited by CPU, memory, disk IO or networking. OS: Ubuntu 
> 14.04
>
> See results at: 
> https://docs.google.com/spreadsheets/d/1yuFD7WDOzhWB5_Ob7XgAfFAdWt48SrthbvZSZ45GE-k/edit?usp=sharing
>
> Starting from the fact that my results are different (spray gives better 
> results than akka-http). In addition I see interesting effects when I use 
> different benchmark tools. I also started from wrk, but in addition to 
> throughput I wanted to see failures if exist, and latency percentiles, so I 
> added  tests with weighttp and ab. 
>
> Throughput reported by ab is much different than the rest and shows 
> drastic difference between akka-http and spray. Reported latency also don't 
> have much in common. I can think that ab (as a single-threaded tool) can be 
> bottleneck itself. But how to explain such a difference in throughput for 
> akka-htttp and spray? And how to explain difference in reported latency.
>
> Regards,
> Olga Gorun
>
>
>
>
>
> -- 
> >> 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 
> .
> 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: Trouble understanding Streams doc for Scala: new user question

2016-10-06 Thread Mike Nielsen
Thanks Tal.

On Thu, Oct 6, 2016 at 2:50 AM, Tal Pressman  wrote:

> Hi,
>
> The type provided to Source.actorRef is the type of the messages emitted
> from the Actor (WorkResult in your case). Success messages can be *sent
> to the actor* in order to cause the stream to complete, but they are
> handled separately and aren't actually emitted to the stream.
>
> As for Map/Collect/Filter/etc., there is actually a stage for it
> (akka.stream.impl.fusing.Map) although I'm not sure they're intended for
> public use (then again, they are public, so...)
>
> Hope this helps,
> Tal
>
>
> On Wednesday, October 5, 2016 at 8:38:26 PM UTC+3, mniel...@gmail.com
> wrote:
>>
>> I'm having a couple of problems understanding the Streams documentation,
>>  in particular, the Overview of built-in stages
>> .
>>
>> My objective is to build, using the GraphDSL, a flow that uses, among
>> others, a Source.actorRef
>>
>>
>> Flow.fromGraph(GraphDSL.create() { implicit b =>
>>
>>   import GraphDSL.Implicits._
>>
>>   val src = b.add(Source.actorRef[Any](bufferSize, OverflowStrategy.
>> fail).mapMaterializedValue(workerSupervisor ! SetWorkRecipient(_)))
>>
>> ...
>>
>> I've used Source.actorRef[Any]because my workerSupervisor (the actor
>> that provides the messages for the source) wants to return a result of type
>> WorkResult
>>
>> However, the documentation says that this stage completes when it
>> receives akka.actor.Status.Success
>>
>> So if I use Source.actorRef[WorkResult] I run into trouble once the work
>> is complete and the  worker wants to signal success, because, of course,
>> the success message is of the wrong type.
>>
>> How can I work around this? I need my stream to emit WorkResult, not Any ;
>> It's not clear from the documentation how to achieve it.
>>
>> Also, the documentation lists the following stages (for example)
>>
>> broadcast, which I add as b.add(Broadcast[T](2)) for example.
>>
>> and
>>
>> map & collect, which can't be added in the same way (i.e. no
>> b.add(Map[T]))
>>
>> yet there is no notation in the documentation that suggests that these
>> stages might be different or used differently.  My thought was to convert
>> the Any  from the Source.actorRef using collect, yet, I'm struggling
>> with doing that.
>>
>> So my 2nd question is, how do I apply map or collect to the output of a
>> Broadcast[T] within the context of a GraphDSL and provide the mapped output
>> as part of the resulting FlowShape?
>>
>> Would you kindly show an example using GraphDSL?
>>
>> Thank you!
>>
>> --
> >> 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 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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Konrad Malawski
That problem does not happen in Akka Streams, it explicitly manages
flow-control by the way.

On Thu, Oct 6, 2016 at 10:03 AM, Viktor Klang 
wrote:

> Of course it builds up if you can't process the messages equal-or-faster
> than you get them?
>
> --
> Cheers,
> √
>
> On Oct 6, 2016 09:49, "Alexander Lukyanchikov" <
> alexanderlukyanchi...@gmail.com> wrote:
>
>>
>> Sorry guys, quick update:
>>
>> Time interval actually affects the situation: if actor job time <
>> scheduler interval, everything is good, no matter how many actors we have.
>>
>> When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes
>> filling up and not garbage collected (millions of them after a few hours).
>> *But if I increase ACTOR_COUNT up to 30, GC starts to delete those
>> not-delivered messages, according to the profiler.*
>>
>> Why? Looks like something in Akka starts working differently after that
>> magic threshold.
>>
>> Any ideas?
>>
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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 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,
Konrad 'ktoso' Malawski
Akka  @ Typesafe 

-- 
>>  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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
Of course it builds up if you can't process the messages equal-or-faster
than you get them?

-- 
Cheers,
√

On Oct 6, 2016 09:49, "Alexander Lukyanchikov" <
alexanderlukyanchi...@gmail.com> wrote:

>
> Sorry guys, quick update:
>
> Time interval actually affects the situation: if actor job time <
> scheduler interval, everything is good, no matter how many actors we have.
>
> When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes
> filling up and not garbage collected (millions of them after a few hours).
> *But if I increase ACTOR_COUNT up to 30, GC starts to delete those
> not-delivered messages, according to the profiler.*
>
> Why? Looks like something in Akka starts working differently after that
> magic threshold.
>
> Any ideas?
>
>
> --
> >> 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 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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
My guess is that your default dispatcher has ~30 threads

-- 
Cheers,
√

On Oct 6, 2016 10:03, "Viktor Klang"  wrote:

> Of course it builds up if you can't process the messages equal-or-faster
> than you get them?
>
> --
> Cheers,
> √
>
> On Oct 6, 2016 09:49, "Alexander Lukyanchikov" <
> alexanderlukyanchi...@gmail.com> wrote:
>
>>
>> Sorry guys, quick update:
>>
>> Time interval actually affects the situation: if actor job time <
>> scheduler interval, everything is good, no matter how many actors we have.
>>
>> When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes
>> filling up and not garbage collected (millions of them after a few hours).
>> *But if I increase ACTOR_COUNT up to 30, GC starts to delete those
>> not-delivered messages, according to the profiler.*
>>
>> Why? Looks like something in Akka starts working differently after that
>> magic threshold.
>>
>> Any ideas?
>>
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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 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: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Alexander Lukyanchikov

Sorry guys, quick update:

Time interval actually affects the situation: if actor job time < scheduler 
interval, everything is good, no matter how many actors we have.

When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes 
filling up and not garbage collected (millions of them after a few hours).
*But if I increase ACTOR_COUNT up to 30, GC starts to delete those 
not-delivered messages, according to the profiler.*

Why? Looks like something in Akka starts working differently after that 
magic threshold.

Any ideas?
 

-- 
>>  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] Memory leak: unexpected mailbox filling up

2016-10-06 Thread Alexander Lukyanchikov
Hi everyone,

We have a pretty weird memory leak - akka.dispatch.Envelope instances are 
not garbage collected.

Here is the code:


List actors = new ArrayList<>(); for (int i = 0; i < ACTOR_COUNT; 
i++) { actors.add(system.actorOf(...)); } for (ActorRef actor : actors) { 
system.scheduler().schedule(FiniteDuration.create(0, TimeUnit.MILLISECONDS), 
FiniteDuration.create(1000, TimeUnit.MILLISECONDS), actor, "Run", system.
dispatcher(), null); }

It creates a number of actors and then creates a scheduler for each of 
them. Actors itself are responsible for querying MQ and then process a 
message.
When ACTOR_COUNT > 30, everything is good. But otherwise, we have a memory 
leak (instances of akka.dispatch.Envelopes with message "Run" are filling 
up and can't be garbage collected)

It's pretty weird, because when we have more actors, then we have more 
messages (1 per second for each of them) - but unexpectedly it STOPS 
filling up when there are more actors/messages.
Time interval (1000 ms) doesn't really affect the situation, it just make 
it slower or faster.

Could you please explain this behavior for me?

Thank you.

-- 
>>  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: Can't figure out how to create Router from a configuration file

2016-10-06 Thread Jawad Kakar
As Rob suggested, please have it in your classpath, if you are using maven 
it should be in " src/main/resources"

On Wednesday, October 5, 2016 at 12:53:22 PM UTC-4, Luigi D'Onofrio wrote:
>
> I have it in *myproject/src/* directory but i got error:
>
> [ERROR] [10/05/2016 17:21:33.097] [System-akka.actor.default-dispatcher-3] 
> [akka://System/user/master] null
> akka.actor.ActorInitializationException: exception during creation
> at akka.actor.ActorInitializationException$.apply(Actor.scala:166)
> at akka.actor.ActorCell.create(ActorCell.scala:596)
> at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
> at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
> at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
> at akka.dispatch.Mailbox.run(Mailbox.scala:219)
> at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(
> AbstractDispatcher.scala:397)
> at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260
> )
> at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(
> ForkJoinPool.java:1339)
> at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:
> 1979)
> at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
> ForkJoinWorkerThread.java:107)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:57)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at akka.util.Reflect$.instantiate(Reflect.scala:66)
> at akka.actor.ArgsReflectConstructor.produce(Props.scala:355)
> at akka.actor.Props.newActor(Props.scala:255)
> at akka.actor.ActorCell.newActor(ActorCell.scala:552)
> at akka.actor.ActorCell.create(ActorCell.scala:578)
> ... 9 more
> Caused by: akka.ConfigurationException: configuration problem while 
> creating [akka://System/user/master/router1] with router dispatcher 
> [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox] 
> and routee dispatcher [akka.actor.default-dispatcher] and mailbox 
> [akka.actor.default-mailbox]
> at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:753
> )
> at akka.actor.dungeon.Children$class.makeChild(Children.scala:206)
> at akka.actor.dungeon.Children$class.actorOf(Children.scala:37)
> at akka.actor.ActorCell.actorOf(ActorCell.scala:369)
> at Actors.Master.(Master.java:27)
> ... 18 more
> Caused by: akka.ConfigurationException: Configuration missing for router [
> akka://System/user/master/router1] in 'akka.actor.deployment' section.
> at akka.routing.FromConfig.verifyConfig(RouterConfig.scala:297)
> at akka.routing.RoutedActorRef.(RoutedActorRef.scala:40)
> at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:751
> )
> ... 22 more
>
> I got this running this: 
> this.workerRouter = getContext().actorOf(Props.create(Worker.class).
> withRouter(new FromConfig()), "router1");
>
> and my application.conf is:
>   
> akka{
> actor{
> deployment {
>   /master/router1 {
> router = round-robin-pool
> nr-of-instances = 5
> }
> }
> }
> }
>
>
>
>
>
>
>  Rob Crawford ha scritto:
>>
>> At run-time it should be in your classpath, at the top-most level.
>>
>> If you're using the Maven project structure, that would be in 
>> src/main/resources
>>
>>
>> On Tuesday, October 4, 2016 at 3:09:48 PM UTC-4, Luigi D'Onofrio wrote:
>>>
>>> Hello guys, i'm farely new to Akka and i'm loving it. 
>>> Today i was trying to create a router using configuration file, but i 
>>> can't figure where the application.conf file should be located and how it 
>>> should be written correctly, can you give me some advise and maybe an 
>>> example?
>>>
>>> Currently using Java 7 + Akka 2.3.15 - Eclipse as IDE.
>>> Thanks in advance!
>>>
>>
> Il giorno mercoledì 5 ottobre 2016 16:57:04 UTC+2, Rob Crawford ha scritto:
>>
>> At run-time it should be in your classpath, at the top-most level.
>>
>> If you're using the Maven project structure, that would be in 
>> src/main/resources
>>
>>
>> On Tuesday, October 4, 2016 at 3:09:48 PM UTC-4, Luigi D'Onofrio wrote:
>>>
>>> Hello guys, i'm farely new to Akka and i'm loving it. 
>>> Today i was trying to create a router using configuration file, but i 
>>> can't figure where the application.conf file should be located and how it 
>>> should be written correctly, can you give me some advise and maybe an 
>>> example?
>>>
>>> Currently using Java 7 + Akka 2.3.15 - Eclipse as IDE.
>>> Thanks in advance!
>>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> 

[akka-user] Re: Trouble understanding Streams doc for Scala: new user question

2016-10-06 Thread Tal Pressman
Hi,

The type provided to Source.actorRef is the type of the messages emitted 
from the Actor (WorkResult in your case). Success messages can be *sent to 
the actor* in order to cause the stream to complete, but they are handled 
separately and aren't actually emitted to the stream.

As for Map/Collect/Filter/etc., there is actually a stage for it 
(akka.stream.impl.fusing.Map) although I'm not sure they're intended for 
public use (then again, they are public, so...)

Hope this helps,
Tal


On Wednesday, October 5, 2016 at 8:38:26 PM UTC+3, mniel...@gmail.com wrote:
>
> I'm having a couple of problems understanding the Streams documentation, 
>  in particular, the Overview of built-in stages 
> .
>
> My objective is to build, using the GraphDSL, a flow that uses, among 
> others, a Source.actorRef
>
>
> Flow.fromGraph(GraphDSL.create() { implicit b =>
>
>   import GraphDSL.Implicits._
>
>   val src = b.add(Source.actorRef[Any](bufferSize, OverflowStrategy.
> fail).mapMaterializedValue(workerSupervisor ! SetWorkRecipient(_)))
>
> ...
>
> I've used Source.actorRef[Any]because my workerSupervisor (the actor that 
> provides the messages for the source) wants to return a result of type 
> WorkResult
>
> However, the documentation says that this stage completes when it receives 
> akka.actor.Status.Success
>
> So if I use Source.actorRef[WorkResult] I run into trouble once the work 
> is complete and the  worker wants to signal success, because, of course, 
> the success message is of the wrong type.
>
> How can I work around this? I need my stream to emit WorkResult, not Any ; 
> It's not clear from the documentation how to achieve it.
>
> Also, the documentation lists the following stages (for example)
>
> broadcast, which I add as b.add(Broadcast[T](2)) for example.
>
> and
>
> map & collect, which can't be added in the same way (i.e. no 
> b.add(Map[T]))
>
> yet there is no notation in the documentation that suggests that these 
> stages might be different or used differently.  My thought was to convert 
> the Any  from the Source.actorRef using collect, yet, I'm struggling with 
> doing that.
>
> So my 2nd question is, how do I apply map or collect to the output of a 
> Broadcast[T] within the context of a GraphDSL and provide the mapped output 
> as part of the resulting FlowShape?
>
> Would you kindly show an example using GraphDSL?
>
> Thank you!
>
>

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