These are chat archives for akkadotnet/akka.net

6th
Apr 2016
Corneliu
@corneliutusnea
Apr 06 2016 07:44
guys, I'm doing a perf-test of akka. I have about 9 actors and 1 messages / unit of work. I try to deliver 50K units of work which is ~450K messages in total
I can see that Akka is maxing out single CPU and never touching any of the other CPUs to scale
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 07:45
@corneliutusnea can you show your code?
Corneliu
@corneliutusnea
Apr 06 2016 07:48
@Horusiath hard to do, it's quite large and complicated and IP owned by customer
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 07:48
what about part when you're sending message to actors?
Corneliu
@corneliutusnea
Apr 06 2016 07:49
_messageReceiveActor.Ask(new LiveReceivedMessage()
            {
                ServiceType = _serviceType,
                Payload = payload
            }, Wait.Seconds(3))
                .ContinueWith(c =>
                {
                    MergeResult v;
                    dict.TryRemove(count, out v);
                });
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 07:50
how do you instantiate the _messageReceiveActor?
Corneliu
@corneliutusnea
Apr 06 2016 07:53
_messageReceiveActor = System.ActorSelection(WellKnownActors.Live.MessageReceive.Path);
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 07:53
and what the path is? ;)
Corneliu
@corneliutusnea
Apr 06 2016 07:54
"akka://MySystem/user/Test.LiveMessageReceive"
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 07:56
  1. You have selected only one actor, and since each single actor processes messages synchronously, everything is working on a single thread.
  2. You're using actor selection, which is slower that using IActorRef directly.
  3. I don't know the context of your operation, but keep in mind, that using Ask is A LOT slower than using Tell.
Corneliu
@corneliutusnea
Apr 06 2016 07:59
  1. Yes, but that actor all it does it verifies the message quickly and then dispatches it to a pool of other actors
  1. Can I get an actorref from a selector ?
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 08:03
For 2: use actorSelection.ResolveOne(timeout) if you're using it outside of an actor, or combination of actorSelection.Tell(new Identify(correlationId)) with Receive<ActorIdentity>(...) when used inside an actor
and concerning 1 - how do you dispatch that message to pool of actors?
and how pool is constructed?
Corneliu
@corneliutusnea
Apr 06 2016 08:06
this is inside the messageReceiveActor PreStart to create the child pool
_liveMessageReceiver = Context.ActorOf(
                Context.DI().Props<LiveMessageReceiverActor>()
                    .WithRouter(new SmallestMailboxPool(10))
                , "LiveMessageReceive");
then in the receive I have some verification that I need then
_liveMessageReceiver.Tell(message);
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 08:11
could you try to replace SmallestMailboxPool with RoundRobin for example?
Corneliu
@corneliutusnea
Apr 06 2016 08:15
tried that, no diff
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 08:18
it's hard to tell, what's wrong without seeing the actual data flow. It looks like you are asking only a single actor each time, maybe even not touching router at all
Corneliu
@corneliutusnea
Apr 06 2016 08:19
i think it's nbench forcing the process to a single processor
Bartosz Sypytkowski
@Horusiath
Apr 06 2016 08:21
@Aaronontheweb I think, we've found something for you :P
Corneliu
@corneliutusnea
Apr 06 2016 08:51
I'll try to write a separate small(er) unit test with nbench. I changed my code to automatically reply back from the _liveMessageReceiver above
and I get 6500msg/second in the beginning, then as nbench runs more it drops quickly to 3500msg/second :(
can't find anything obvious even with perfmon .. v. little memory growth, great perf decrease after ~1M messages
the only thing that grows in perfmon is threadcount
hidavidpeng
@hidavidpeng
Apr 06 2016 09:51
Hi I had my actor implemented the IStash interface. So It can cache the message temporary until I wanted.
But i'm curious now that my message is queued in the mailbox. So why I need the IStash or when i use the IStash feature.
Can u give me some ideas? thank you.
@Silv3rcircl3 I think so haha.
Marc Piechura
@marcpiechura
Apr 06 2016 09:58
@hidavidpeng when you stash a message you can process other messages in the meantime and when you are ready you put them from the stash back into the mailbox. for example an actor that needs some kind of init message, you could stash all other messages until you receive that init message and then unstash them
hidavidpeng
@hidavidpeng
Apr 06 2016 10:05
@Silv3rcircl3 ,thank you.It sounds great. WanMei.
jpvdmerwe
@jpvdmerwe
Apr 06 2016 11:46
Hi, has anybody had success with getting Akka.NET to work on Xamarin?
Weston
@ronnyek
Apr 06 2016 14:34
am I crazy for thinking akka, or actor systems in general sound an aweful lot like microservices in general with some differences in terminology, and thinking about how things are structured?
I've looked at services as in wcf services, service fabric and akka, and none seem to get me near where I want to be
that is a cloud of actors that I can version, I can communicate transparently between diff nodes in the same cloud, and locate services that handle some interface and just call them
(optimizing for communications... eg, getting local instances prior to going off to another node)
seems like of that thats not there, that should be fairly easy to build in akka
Aaron Stannard
@Aaronontheweb
Apr 06 2016 16:10
@Horusiath @corneliutusnea NBench is supposed to force the processor affinity
it's one of the techniques used to isolate OS noise
unfortunately that constraint has no impact on multi-threaded code
only on the main thread
(foreground thread)
@jpvdmerwe yes: akkadotnet/akka.net#1620
Aaron Stannard
@Aaronontheweb
Apr 06 2016 17:30
I can see that Akka is maxing out single CPU and never touching any of the other CPUs to scale
hmmm
maybe I was wrong about the processor affinity...
Weston
@ronnyek
Apr 06 2016 17:48
anyone able to confirm my sanity? or lack thereof?
Vlad Kosarev
@vladkosarev
Apr 06 2016 18:17

is there anything special with TestKit and DI or should this just work - AutoFacDependencyResolver(container, Sys);?

It doesn't crash in a test but nothing happens, creating an actor without DI works fine.

Arjen Smits
@Danthar
Apr 06 2016 18:44
That looks ok.
how are you resolving your test actors ?
Aaron Stannard
@Aaronontheweb
Apr 06 2016 19:10
@ronnyek I think you're right on
Aaron Stannard
@Aaronontheweb
Apr 06 2016 21:01
Akka.NET 1.0.7 rolling down the rails here: akkadotnet/akka.net#1855
Corneliu
@corneliutusnea
Apr 06 2016 22:14
@Aaronontheweb Yes, NBench forces the app to stick to one CPU. I'm changing Nbench now to add an option to not do that to see if perf improves
Aaron Stannard
@Aaronontheweb
Apr 06 2016 22:14
@corneliutusnea beat you to it: petabridge/NBench#92
going to try to ship NBench v0.2 today in addition to Akka.NET v1.0.7
NBench v0.2 has most of the stuff I need to lay the groundwork for a VS plugin
the status API for Github is fucked up today
watching it time out on some NBench specs where TC passed it
Aaron Stannard
@Aaronontheweb
Apr 06 2016 22:22
increased our max concurrent build server count to 7
since we have a lot of stuff happening at once and the work queue was getting long
Aaron Stannard
@Aaronontheweb
Apr 06 2016 22:50
ok, just pushed Akka.NET v1.0.7
should be up on NuGet in about 10 minutes
(need to wait on the build server to package and deploy everything)
everything is live on NuGet
Damian Reeves
@DamianReeves
Apr 06 2016 23:01
:clap:
Corneliu
@corneliutusnea
Apr 06 2016 23:26
@Aaronontheweb thanks, did you release that nbench update?
Aaron Stannard
@Aaronontheweb
Apr 06 2016 23:26
yessir!
waiting for it to get indexed on NuGet
just rolled it out
looks like I screwed up on loading the logo file
doh
NBench has a couple of new things in that release I'm excited about
the ElapsedTimeAssertion is pretty cool for long-running stuff
the plugin model for instrumenting metrics from sources NBench doesn't support by default
Corneliu
@corneliutusnea
Apr 06 2016 23:28
@Aaronontheweb You should have let the change of Process Priority even when run in concurrent mode
Aaron Stannard
@Aaronontheweb
Apr 06 2016 23:29
oh, the thread priority?
no, the Process priority not the thread
Aaron Stannard
@Aaronontheweb
Apr 06 2016 23:29
damn, so you're right
mind sending me a PR for that - now I have an excuse to fix the logo too
v0.2.1 :p
you can just pass the Concurrent flag into the SetProcessPriority flag and change it there
so we skip the affinity part but leave the priority
Corneliu
@corneliutusnea
Apr 06 2016 23:40
done
argh ... just noticed ... tabs vs spaces in files .. my fault ... leave it like that for now, code is correct
Aaron Stannard
@Aaronontheweb
Apr 06 2016 23:41
don't make me go all whitespace religion on you pal!
I'll fix that in the release - there's a tool in VS that keeps this stuff consistent project to project
can't remember what it is anymore
Corneliu
@corneliutusnea
Apr 06 2016 23:42
I'm willing to start a fight :) pro Tabs :) hahahah
Aaron Stannard
@Aaronontheweb
Apr 06 2016 23:42
spaces always win since the Tabalamo