From e5e0780f5ec80acac574d28a012193d58ebe89b5 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 24 Nov 2026 20:05:26 -0500 Subject: [PATCH] =?UTF-8?q?perf(grpc-data):=20A3b=20review=20S5=20?= =?UTF-8?q?=E2=80=94=20BytesPerCondition=20from=20the=20worst-case=20L2=20?= =?UTF-8?q?harness=20(max=20228,353=20B=20=E2=87=92=20230,000;=20cap=20?= =?UTF-8?q?=E2=89=88=20548=20MiB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configuration/DataConnectionOptions.cs | 2 +- .../DataConnections/ProjectedConditionAccess.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionOptions.cs b/src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionOptions.cs index 2be47ff68..ca67a3563 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionOptions.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionOptions.cs @@ -21,7 +21,7 @@ public sealed class DataConnectionOptions public long MaxTransportBytes { get; set; } = 64 * 1024 * 1024; /// A3 (§5.5): imported-condition node budget per consumer node (2,500 × 49 worst-case nodes per condition). public int MaxImportedConditionNodes { get; set; } = 122_500; - /// A3 (§5.5): imported-condition memory budget per consumer node (§9.3 L2: measured 205,665 B/condition × 2,500 ≈ 490 MiB). + /// A3 (§5.5): imported-condition memory budget per consumer node (§9.3 L2: worst-case measured 230,000 B/condition × 2,500 ≈ 548 MiB). public long MaxImportedConditionBytes { get; set; } = ZB.MOM.WW.OtOpcUa.Runtime.DataConnections.ProjectedConditionOptions.DefaultMaxImportedConditionBytes; public long MaxPendingBytes { get; set; } = 1024 * 1024; public TimeSpan MaxSessionLifetime { get; set; } = TimeSpan.FromHours(1); diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedConditionAccess.cs b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedConditionAccess.cs index 14c0345fa..1aaf9b93c 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedConditionAccess.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedConditionAccess.cs @@ -40,7 +40,7 @@ public sealed class DeployedConditionMappings : IProjectedConditionMappings /// A3 host limits (§5.5 "Budget"). /// How long a connection's condition items stay open after the last event item goes (default 30 s). /// Per consumer node (default 122,500 = 2,500 × 49). -/// Per consumer node (default = L2-measured × 2,500 ≈ 490 MiB). +/// Per consumer node (default = L2-measured × 2,500 ≈ 548 MiB). /// Pause before re-opening an ended condition stream. public sealed record ProjectedConditionOptions(TimeSpan Linger, int MaxImportedConditionNodes, long MaxImportedConditionBytes, TimeSpan ReconnectDelay) @@ -50,9 +50,10 @@ public sealed record ProjectedConditionOptions(TimeSpan Linger, int MaxImportedC /// /// Retained managed bytes per imported condition, measured by the A3 L2 harness (1,000 conditions in one mapping on a /// running SDK 2.0.1 server: node + children + ids + registry/indexes + EventId registry + verdict cache; X0's - /// node-only harness measured 160,997). The managed-heap figure is used: it is higher than the working-set growth. + /// node-only harness measured 160,997). A3b review S5: the WORST case — two placements, all 32 EventId slots, three + /// event items, the runner's Live + Buffer records — max of three runs 228,353 B (managed heap), rounded up. /// - public const long BytesPerCondition = 205_665; + public const long BytesPerCondition = 230_000; /// §9.3 L2: the host byte cap = measured per-condition bytes × 2,500 (the host condition cap). public const long DefaultMaxImportedConditionBytes = BytesPerCondition * 2_500;