akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.66k stars 1.04k forks source link

[PERF] Using the BroadcastHub with thousands of consumers seems painfully slow. #7253

Open RollsChris opened 3 weeks ago

RollsChris commented 3 weeks ago

Version Information Akka.Streams="1.5.20"

Describe the performance issue I'm trying to create thousands of consumers for a BroadCastHub.

Each consumer listens to the stream and checks if they care about the current item.

As the number increases the performance slows considerably.

We think the buffer plays apart because as soon as we go past the buffer value things get really slow but we are unsure.

We also think that when the buffer gets full there is a potential for it to drop messages, as some values we never see.

Here is a LinqPad URL to demo the issue: LinqPad

Expected behavior Should be able to process 14000 messages across 14000 consumers using a BroadCastHub within seconds

Actual behavior Becomes un-usable in the thousands.

Environment LinqPad demo We are using Linux docker images in product, same performance issue.

Aaronontheweb commented 3 weeks ago

Thank you for the reproduction! I'll see what we can do here.