These are chat archives for akkadotnet/akka.net

28th
Feb 2015
Aaron Stannard
@Aaronontheweb
Feb 28 2015 00:10
for anyone who wants to read the original Akka source - this is a life saver: http://jim-mcbeath.blogspot.com/2008/12/scala-operator-cheat-sheet.html
Roger Johansson
@rogeralsing
Feb 28 2015 08:25
:+1
Roger Johansson
@rogeralsing
Feb 28 2015 15:27
This is where the remoting fails for mono:
            try
            {
                var addressPromise = new TaskCompletionSource<IList<ProtocolTransportAddressPair>>();
                _endpointManager.Tell(new EndpointManager.Listen(addressPromise));

                addressPromise.Task.Wait(Provider.RemoteSettings.StartupTimeout);
                var akkaProtocolTransports = addressPromise.Task.Result;
Task.Result hangs forever
Roger Johansson
@rogeralsing
Feb 28 2015 15:43
I get a Listen message in the endpoint manager.. then there are coming in some Prune messages into the endpointmanager too, which it doesnt handle?
cc @Aaronontheweb
ah, it does that in accepting phase , but it is not in that phase
Roger Johansson
@rogeralsing
Feb 28 2015 15:54
hmmm Listens never completes, so the remoting is stuck in startup
         _listens = Task.WhenAll(tasks).ContinueWith(transportResults => transportResults.Result.ToList(), TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.AttachedToParent);
Aaron Stannard
@Aaronontheweb
Feb 28 2015 17:58
@rogeralsing try doing this on that line - I see a bug in the TaskContinuationOptions
 _listens = Task.WhenAll(tasks).ContinueWith(transportResults => transportResults.Result.ToList(), TaskContinuationOptions.ExecuteSynchronously & TaskContinuationOptions.AttachedToParent);
meant to use bitwise AND
not bitwise OR
Mono's TPL implementation might check for those flags differently
coffeeyesplease
@coffeeyesplease
Feb 28 2015 19:40
Hi there all. I’m about to use Akka.Net on a ASP.NET MVC application. The intention is here is to have communicate with another process remotely. My question is, do remote connections timeout?
thanks in advance
Aaron Stannard
@Aaronontheweb
Feb 28 2015 19:45
Akka.Remote connections are perpetual unless one side of the connection fails to deliver heartbeats to the other
I don't recall what the default heartbeat settings are, I think 1 per second or 500ms
and if more than 3-4 heartbeats get missed then the connection is considered unhealthy and gets restarted
Akka.Remote connections are lazy too - outbound only turn on the first time you try to send a message to a remote address
but it listens for incoming connections immediately
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:12
@coffeeyesplease was my answer helpful at all? If not let me know - happy to help out with Remoting since we don't have a lot of literature on it at the moment.
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:19
@Aaronontheweb brilliant! Yes very helpful indeed.
I’m already following your advice in starting it all on Global.asax with a static reference
thank you :)
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:24
good, that's a best practice
I had some plumbing I wrote somewhere that was pretty small - maybe 100-200 lines of code that made it very easy for all ASP.NET MVC controllers to publish messages to actors without needing to load any Akka.NET references inside the controllers themselves
via a static Publisher class or something
that I wired up with a reference to a specific router actor that published messages to remote systems
that only works if you don't need messages back from your actors though :p
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:27
actually I don’t.. it’s all one way.. if the actor finishes the process.. then great.
if not then, oh well...
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:28
yeah, mine was the same way - had to hand off a massive amount of messages per second to our analytics system
front-end API just needed to acknowledge that we had received them
didn't need to acknowledge if we had finished post-processing
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:28
I have a look around… in these coming weeks I’ll be knee deep in Akka.Net
that’s precisely the problem I’m also trying to solve
:)
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:29
cool, well feel free to hit me up - aaron@petabridge.com
currently working on making it easy to do this stuff with the clustering module on top of Akka.Remote :p
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:30
we’ll definitely stay in touch then.
this is basically the reason why I turned to Akka.NET is to get millions of messages that go through our analytics system. So I’ll probably well be looking for advice sometime soon
:)
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:32
awesome
at peak loads I did about 20 million remote messages per day per Akka.Remote node (on the receiving end)
overhead was super minimal - like 3-15% CPU utilization on a medium-sized box on EC2
for that workload even at peak hours
your mileage may vary :p
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:34
all right.. that’s very encouraging.
I’m still studying the architecture for this project.. because right now (for this client in particular and with our database) the number of messages is just waay too inneficient…. 600M a day
its just feels like a waste of bandwidht if you ask me
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:37
is all of that over HTTP?
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:37
God no
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:37
thank God
I was going to say
I hope your EC2 sales rep / whatever vendor you use drives a nice car
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:38
lol
These guys have their own machines/data center
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:40
but yeah, that sounds like a lot of messages
although in-process messages within akka.net are dirt cheap from an overhead point of view
remote messages, less so - serialization overhead on both ends of the connection can add up
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:41
Yeah. My first job is to actually reduce the number of messages
it did some remoting testing.. and firing 1M took the sender something 700ms...
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:42
/flex
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:42
but a bit longer to get to the other side
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:43
one thing I haven't tested
but would like to
hmmm, actually
Roger Johansson
@rogeralsing
Feb 28 2015 20:43
Do we have any benchmarks on remoting throughput?
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:44
@rogeralsing not really - I've benchmarked Helios before and it's able to handle a pretty stupid amount of traffic without falling down
something like 250,000 reads per second on 2 threads at 3-4% CPU
never done anything like that for Akka.Remote though
what I'd like to do ideally is add a benchmarking system for Akka.Cluster
test how different cluster sizes perform
and make it pluggable for people's apps
as for what you were saying @coffeeyesplease - I think the reason the recieving end is slower is because of how remote messages get delivered to their recipients
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:46
[disclaimer]: I’m not experienced with neither helios os Akka.Net
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:46
I think everything gets done as an actor selection
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:46
I’ve with helios and it was damn fast
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:47
so it takes some time to resolve each of those to an ActorRef
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:47
I can’t remember teh numbers but it was really fast, but for some strange reason I was losing some of the messages
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:48
if it was the same message each time and it didn't get logged by dead letters then it could be an issue with Helios' message decoding
Roger Johansson
@rogeralsing
Feb 28 2015 20:48
Actually, i did see some messageloss when i had the students writing their paper
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:48
hmmm!!!
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:49
next thing I'm working on after we ship Akka.Cluster is Helios 2.0, which has a better model for dealing with that problem
it's going to follow Netty's design much more closely than the current version
(Akka.Cluster will ship after Akka.NET 1.0 is released)
Roger Johansson
@rogeralsing
Feb 28 2015 20:49
Aaron, we should take a look if that was just my naive testcase or if it is a real issue
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:50
if you have some bits that you can send me i can take a look
if it's a Helios issue then I know exactly where the problem is
it's the LengthFrameDecoder
either it or the ByteBuf sitting on top of it grabs only a partial chunk of a message
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:51
yeah, I try and find the test
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:51
the decoder reads some bytes that aren't actually the length-frame header
assumes the message is corrupt
and discards bytes until the buffer is empty
coffeeyesplease
@coffeeyesplease
Feb 28 2015 20:52
it as basically sending logs messages the around. 128 len string
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:52
it's possible that there's some race conditions I never caught with the reactive part of the socket
Roger Johansson
@rogeralsing
Feb 28 2015 20:52
Found their test, mailed you
Aaron Stannard
@Aaronontheweb
Feb 28 2015 20:54
thanks
I'll take a look at that
I've had a spec written down on paper, quite literally - in my notebook, for Helios 2.0 and I'm desperate to work on it because I think it'll finally be easy to work directly with Helios once I've made those changes :p
Helios' current API is simple but not the most intuitive
Aaron Stannard
@Aaronontheweb
Feb 28 2015 21:09
@rogeralsing btw, have virtual nodes and all of that fun stuff implemented now
had to rewrite our Murmur3 implementation in order to support it
(followed the Scala implementation - it wasn't so different from mine, just optimized for being able to construct a hash in discrete steps)
(rather than treating it like a black-box all-or-nothing operation)
Roger Johansson
@rogeralsing
Feb 28 2015 21:20
Nice :)
Roger Johansson
@rogeralsing
Feb 28 2015 21:51
@Horusiath are you by any chance an old WoW gamer? from the looks of your alias :)
Aaron Stannard
@Aaronontheweb
Feb 28 2015 22:17
@/all Unit2 for Akka.NET bootcamp is now available ;) https://github.com/petabridge/akka-bootcamp/tree/master/src/Unit-2
jcwrequests
@jcwrequests
Feb 28 2015 23:57
@aaronontheweb the boot camp looks awesome. I will be adding it to my personal work load for the coming week. Good job 👍