Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Akka to up-to-date version #1455

Closed
vncoelho opened this issue Feb 27, 2020 · 6 comments · Fixed by #1466
Closed

Update Akka to up-to-date version #1455

vncoelho opened this issue Feb 27, 2020 · 6 comments · Fixed by #1466
Labels
Discussion Initial issue state - proposed but not yet accepted

Comments

@vncoelho
Copy link
Member

According to akkadotnet/akka.net#2378 (comment) there might be benefits in the P2P on the last version.

As #611 mentioned and discussed in other threads.

image

@vncoelho vncoelho added the Discussion Initial issue state - proposed but not yet accepted label Feb 27, 2020
@ShawnYun
Copy link
Contributor

That sounds good.

@shargon
Copy link
Member

shargon commented Feb 27, 2020

Good news :)

@ShawnYun
Copy link
Contributor

ShawnYun commented Mar 6, 2020

Major changes from Akka 1.3 to Akka1.4 include:

1.Akka.Remote's performance has significantly increased as a function of our new batching mode- which is tunable via HOCON configuration to best support your needs.

The default transport in Akka.Remote is the DotNetty TCP transport, which is a good choice for most Akka.NET developers because TCP preserves message order and guarantees delivery of every message over the wire so long as the network remains available, which is consistent with IActorRef default messaging. The same cannot be said for alternative transports such as a UDP transport.
As of Akka.NET v1.4.0-beta4, we've added a new feature to Akka.Remote called a "batch writer" which has tremendously improved the performance of outbound writes in Akka.Remote by grouping many logical writes into a smaller number of physical writes (actual flush calls to the underlying socket.)
Here are some performance numbers from our RemotePingPong benchmark, which uses high volumes of small messages.
These numbers were all produced on a 12 core Intel i7 2.6Ghz Dell laptop over a single Akka.Remote connection running .NET Core 2.1 on Windows 10:


It can be seen that the average performance after improvement is 141,091 MSG /s, which is 1.7 times higher than before. The standard deviation was 15,291 MSG /s, indicating that the stability of the new akka was greatly enhanced。
Akka.Remote's flush batching system for DotNetty operates on the principle of trying to minimize the number of system calls to the I/O system because they are (1) expensive and (2) unpredictably long-running. Our data shows grouping together dozens of small writes, ~218 bytes per message in this sample, into larger payloads in the 4kb range significantly reduces the standard deviation for this benchmark, significantly improves the average, and also increases the maximum absolute throughput observed.

akka.remote.dot-netty.tcp{
      batching{
        enabled = true
        max-pending-writes = 30
        max-pending-bytes = 16k
        flush-interval = 40ms
      }
}

The batching system inside the DotNetty TCP transport works using the following business rules.
Only flush to the underlying transport when one of these happens:

  1. batching.max-pending-writes - When 30 total messages, irrespective of their size, are queued for writing - flush the batch immediately upon receiving the 30th write;
  2. batching.max-pending-bytes - When 16kb worth of messages have been queued, regardless of the number of messages, flush the batch immediately;
  3. batching.flush-interval - If neither of the two previous conditions have been met flush whatever is waiting inside the queue for this connection within 40 milliseconds.
    you can disable batching via akka.remote.dot-netty.tcp.batching.enabled = false.

2.All HOCON Config objects have been moved from the Akka.Configuration namespace within the core Akka library to the stand-alone HOCON project and its subsequent HOCON.Configuration NuGet package.
So we need to

  1. Change all Akka.Configuration.Config calls to Hocon.Config and
  2. Add using Hocon; statements to wherever you work with HOCON directly.

Conclusion:
Akka1.4 has many improvements, but the two most important ones for NEO are the above.
After upgrading to Akka1.4, the overall performance and stability of the system will be greatly improved.

@vncoelho
Copy link
Member Author

vncoelho commented Mar 6, 2020

Great compilation @ShawnYun, could you proceed with the PR?

@ShawnYun
Copy link
Contributor

ShawnYun commented Mar 9, 2020

@vncoelho Yes, I will test it and send the PR.

@Tommo-L
Copy link
Contributor

Tommo-L commented Mar 16, 2020

Waiting for a more stable release version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Initial issue state - proposed but not yet accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants