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

[PERF]: replace DotNetty transport with home-spun Akka.Streams + System.IO TCP implementation #7225

Open
Aaronontheweb opened this issue Jun 3, 2024 · 0 comments

Comments

@Aaronontheweb
Copy link
Member

Version Information
Version of Akka.NET? v1.5.22 and later
Which Akka.NET Modules? Akka.Remote

Describe the performance issue

In order to resolve #7191 we had to upgrade to a newer version of DotNetty (v0.7.6); unfortunately, this newer version of DotNetty is roughly 10% slower than the v0.6.0 version we've been using for many years.

Data and Specs

Numbers for v0.6.0 and v0.7.6, per #7198 (comment)

DotNetty 0.7.6

OSVersion:                         Microsoft Windows NT 10.0.22631.0                    
ProcessorCount:                    16                                                   
ClockSpeed:                        0 MHZ                                                
Actor Count:                       32                                                   
Messages sent/received per client: 200000  (2e5)                                        
Is Server GC:                      True                                                 
Thread count:                      46                                                   
                                                                                        
Num clients, Total [msg], Msgs/sec, Total [ms], Start Threads, End Threads              
         1,  200000,    123763,    1616.32,            46,              73              
         5, 1000000,    386101,    2590.66,            81,              90              
        10, 2000000,    662691,    3018.54,            98,             104              
        15, 3000000,    666223,    4503.86,           112,             113              
        20, 4000000,    669681,    5973.89,           121,             113              
        25, 5000000,    669255,    7471.86,           121,             105              
        30, 6000000,    669121,    8967.61,           113,              92              
Done..                                                                                  

DotNetty 0.6.0

OSVersion:                         Microsoft Windows NT 10.0.22631.0        
ProcessorCount:                    16                                       
ClockSpeed:                        0 MHZ                                    
Actor Count:                       32                                       
Messages sent/received per client: 200000  (2e5)                            
Is Server GC:                      True                                     
Thread count:                      46                                       
                                                                            
Num clients, Total [msg], Msgs/sec, Total [ms], Start Threads, End Threads  
         1,  200000,    125000,    1600.62,            46,              76  
         5, 1000000,    494072,    2024.04,            84,              95  
        10, 2000000,    713013,    2805.73,           103,             107  
        15, 3000000,    724463,    4141.38,           115,             115  
        20, 4000000,    714669,    5597.66,           123,             123  
        25, 5000000,    684932,    7300.37,           131,             107  
        30, 6000000,    694525,    8639.88,           115,              93  
Done..                                                                      

That's a 10% performance hit or so just to solve a CVE with no real world exposure :\

Expected behavior

Obviously, better performance would be nice. Thus one thing we're considering doing is taking some of the work we've been applying to TurboMqtt, namely petabridge/TurboMqtt#123

We believe we can do this prior to the v1.6 roadmap and achieve even better performance than DotNetty v0.6.0 could, while also maintaining full support for important DotNetty settings such as TLS.

Actual behavior

In the short run, a minor performance degradation from Akka.NET v1.5.22 onwards.

Environment

Windows under x64 on .NET 8, but I expect this issue will show up on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant