These are chat archives for akkadotnet/akka.net

17th
Sep 2017
Chris Ochs
@gamemachine
Sep 17 2017 06:31
So long time user of akka but decided to give orleans a shot on my current game. I've noticed something very different at a core level, which is orleans is slow as hell. SOme of it is the serialization, but some of it appears to be that await is just slow. Does akka internally use some magic to make sending messages faster then a simple await?
on akka jvm as of around 2 years ago, the same basic logic I was pushing 50k messages second. Akka.net I didn't do as much testing, but it wasn't far behind at around the same cpu load. Orleans falls over at the same load, doesn't even get 20% of the way there
Ronny Carlansson
@lessismore1
Sep 17 2017 08:19
Unable to find documention of HOCON. Need info about - akka.actor.ask-timeout. Pointers?
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 08:24
@lessismore1 akka.actor.ask-timeout was not originally part of JVM config, since in Scala you always have timeout as implicit parameter. We added it to allow people to set a global timeout on their Ask requests, so they don't need to pass timeouts each time. By default it's null (for backward compatibility story), but you can set it to any HOCON time value (i.e. 5s, 500ms etc.)
Ronny Carlansson
@lessismore1
Sep 17 2017 08:26
Thanks for a quick reply! :) Working...
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 08:32
@gamemachine it's more the Orleans side - when you're calling grain methods, it's not just a simple await.
Ronny Carlansson
@lessismore1
Sep 17 2017 10:10
Tried ImmutableSortedDictionary as actor state in a persistenceactor. Snapshots fails to load due to an requirement NewtonSoft have on immutables. Any hints?
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 13:53
@lessismore1 you may define your custom converter for json.net, or even better, you may define a custom serializer with well defined schema (i.e. protobuf, msgpack, ms bond)
Ronny Carlansson
@lessismore1
Sep 17 2017 16:18
@Horusiath tried hyperion - same result. Something wrong the settings?
```
    serializers {
        hyperion = ""Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion""
        bytes = ""Akka.Serialization.ByteArraySerializer""
    }
    serialization-bindings {
      ""System.Object"" = hyperion
      ""System.Byte[]"" = bytes
    }
```
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 18:04
@lessismore1 don't use Hyperion serializer for persistence - it's an anti-pattern
can you say what type are you actually trying to serialize?
Robert Stiff
@uatec
Sep 17 2017 18:38
why is it an antipattern for persistence?
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 19:01
@uatec Hyperion should not be used for persistence for several reasons:
  1. Most important it's still in beta and its binary format is unstable - it can be changed in the future. This means, that if you upgrade Hyperion library to newer version, you may be not able to deserialize your data any longer.
  2. It uses a schema, but it's not defined explicitly like ie. in case of protobuf or msgpack. This means that if you shuffle order of the fields in your class, you may not be able to deserialize them any longer, or even worse i.e. deserialize value of field X as value of field Y- no error will be throw but the state of your data will be corrupted.
  3. It's created for remoting - once we start using more advanced features of hyperion like sessions, some of the payload bytes will be context-dependent i.e. we won't be sending the same object twice over the wire, instead we can send only an identifier to an object we've send previously. It's great for connection-scoped messaging, but it will break in case of persistence.
ziya
@mtmk
Sep 17 2017 20:35
Hey guys. Just created a simple cluster example using docker etc: https://github.com/mtmk/akkadotnetexamples/tree/master/containerized I'd really appreciate if anyone gives it a quick whirl and feedback.. thank you :smile: