perf(runtime): raise opcua pinned dispatcher throughput 1 -> 100

This commit is contained in:
Joseph Doherty
2026-08-15 12:07:05 -04:00
parent b857df8a12
commit 1320f3fa08
2 changed files with 16 additions and 3 deletions
@@ -109,8 +109,15 @@ akka {
# Pinned dispatcher used by OpcUaPublishActor (Task 44) so the OPC UA SDK sees
# only one thread per actor instance — its session/subscription locks expect
# strict single-threaded access.
#
# throughput is NOT what provides that guarantee: the PinnedDispatcher does, by
# giving the actor its own dedicated thread. throughput only sets how many queued
# messages drain per scheduling run, so 100 removes a mailbox re-schedule
# round-trip per message on the hottest actor in the process with zero change to
# concurrency. Must stay in sync with the inline HOCON copy in
# ServiceCollectionExtensions.WithOtOpcUaRuntimeActors.
opcua-synchronized-dispatcher {
type = "PinnedDispatcher"
executor = "thread-pool-executor"
throughput = 1
throughput = 100
}
@@ -302,12 +302,18 @@ public static class ServiceCollectionExtensions
// bootstrap their own HOCON (e.g. ServiceCollectionExtensionsTests) wouldn't pick it up
// — OpcUaPublishActor.Props pins itself to opcua-synchronized-dispatcher and Akka throws
// ConfigurationException if it doesn't exist. Prepend a fallback so the runtime extension
// is self-contained.
// is self-contained. Keep this block identical to the akka.conf one.
//
// The OPC UA SDK's single-threaded session/subscription requirement is guaranteed by the
// PinnedDispatcher alone (a dedicated thread per actor instance), not by throughput.
// throughput only sets how many queued messages drain per scheduling run, so 100 removes a
// mailbox re-schedule round-trip per message on the hottest actor in the process with zero
// change to concurrency.
builder.AddHocon(@"
opcua-synchronized-dispatcher {
type = ""PinnedDispatcher""
executor = ""thread-pool-executor""
throughput = 1
throughput = 100
}
", HoconAddMode.Prepend);