The issue here appears to be that the messages we're attempting to route to the entity actors starve out the messages needed to allocate the shards where those entity actors will live. That's a problem.
This issue does not occur when:
remember-entities = off
state-store-mode = persistence - although I haven't tried this using a for-real Akka.Persistence store yet. Only the defaults (in-memory journal, file system snapshot.)
This leads me to believe that the performance issue here is likely caused by how we interact with the DurableStore when using DData mode.
Expected behavior
I'd expect the ShardRegion to be able to support the creation of thousands of entities per second, particularly at node startup when remember-entities = on and it should be able to still allocate shards while it's doing that AND processing new messages intended for those entities.
Actual behavior
The system locked up and the buffer perpetually filled up.
Environment
.NET Core 3.1, Windows 10 bare metal
.NET Core 3.1, Ubuntu 20.04, WSL2
Version Information Version of Akka.NET? v1.4.23 (and also reproduced with v1.4.22) Which Akka.NET Modules? Akka.Cluster.Sharding + DData
Occurs on Linux and Windows
Describe the performance issue Using a reproduction sample I created while testing our solution for https://github.com/akkadotnet/akka.net/issues/5174, I used the following configuration + code:
The sharding configuration is very vanilla - a basic setup without many frills.
Data and Specs This configuration allowed for:
ShardRegion
msg/sWithin a few seconds of starting up the solution, I began receiving messages along the lines of:
The issue here appears to be that the messages we're attempting to route to the entity actors starve out the messages needed to allocate the shards where those entity actors will live. That's a problem.
This issue does not occur when:
remember-entities = off
state-store-mode = persistence
- although I haven't tried this using a for-real Akka.Persistence store yet. Only the defaults (in-memory journal, file system snapshot.)This leads me to believe that the performance issue here is likely caused by how we interact with the
DurableStore
when usingDData
mode.You can see the full demo here: https://github.com/Aaronontheweb/Akka.Cluster.Sharding.DDataDemo
Expected behavior I'd expect the
ShardRegion
to be able to support the creation of thousands of entities per second, particularly at node startup whenremember-entities = on
and it should be able to still allocate shards while it's doing that AND processing new messages intended for those entities.Actual behavior The system locked up and the buffer perpetually filled up.
Environment .NET Core 3.1, Windows 10 bare metal .NET Core 3.1, Ubuntu 20.04, WSL2