gRPC data: projected reads reserve 4 MiB each against a 1 MiB default MaxPendingBytes — one projected origin read in flight at a time #960

Closed
opened 2026-12-01 19:56:13 -05:00 by dohertj2 · 1 comment
Owner

Found while fixing #938.

ProjectedDataAccess admits a projected read (ScheduleRead / ReadNowAsync) by reserving the request's byte budget, min(ProjectedReadBytes = 4 MiB, MaxUnaryBytes), against MaxUnaryBytes. Production wires MaxUnaryBytes = DataConnections:MaxPendingBytes, default 1 MiB (DataConnectionOptions). So every projected read reserves the whole budget and only one projected origin read (and no concurrent projected write) can be in flight per consumer node — MaxConcurrentCalls = 64 never comes into play.

Since #938 a maxAge=0 batch read is pumped through that single slot (correct, but serial: N nodes = N origin round trips, bounded by the 5 s read wait). Concurrent readers/writers contend for it.

Options: size the reservation from the node's metadata (scalar vs array/string bound), batch a request's projected reads into ONE multi-item origin ReadRequest, or raise the default. Needs a measurement on the rig with ScadaBridge-sized batches.

Refs: src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedDataAccess.cs (TryAdmitRead), src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionRegistration.cs (limits), docs/ReadWriteOperations.md.

Found while fixing #938. `ProjectedDataAccess` admits a projected read (`ScheduleRead` / `ReadNowAsync`) by reserving the request's byte budget, `min(ProjectedReadBytes = 4 MiB, MaxUnaryBytes)`, against `MaxUnaryBytes`. Production wires `MaxUnaryBytes = DataConnections:MaxPendingBytes`, default **1 MiB** (`DataConnectionOptions`). So every projected read reserves the whole budget and **only one projected origin read (and no concurrent projected write) can be in flight per consumer node** — `MaxConcurrentCalls = 64` never comes into play. Since #938 a maxAge=0 batch read is pumped through that single slot (correct, but serial: N nodes = N origin round trips, bounded by the 5 s read wait). Concurrent readers/writers contend for it. Options: size the reservation from the node's metadata (scalar vs array/string bound), batch a request's projected reads into ONE multi-item origin `ReadRequest`, or raise the default. Needs a measurement on the rig with ScadaBridge-sized batches. Refs: `src/Server/ZB.MOM.WW.OtOpcUa.Runtime/DataConnections/ProjectedDataAccess.cs` (`TryAdmitRead`), `src/Server/ZB.MOM.WW.OtOpcUa.Host/Configuration/DataConnectionRegistration.cs` (limits), `docs/ReadWriteOperations.md`.
dohertj2 added the type:followuppriority:p2 labels 2026-12-01 19:56:13 -05:00
Author
Owner

Fixed in 75e6ff9af (merged to master, not yet pushed); evidence docs/plans/evidence/grpc-data-ext/960-961.md (4x250 ms maxAge=0 reads: 1016 ms -> 285 ms). Post-merge: Runtime DataConnections 1010/1010, OpcUaServer.Tests 1460/2 skip, OpcUaServer.IntegrationTests GrpcData 39/39, Host 210/210, solution build clean. Not yet run on the gRPC data rig (rides #915).

Fixed in 75e6ff9af (merged to master, not yet pushed); evidence docs/plans/evidence/grpc-data-ext/960-961.md (4x250 ms maxAge=0 reads: 1016 ms -> 285 ms). Post-merge: Runtime DataConnections 1010/1010, OpcUaServer.Tests 1460/2 skip, OpcUaServer.IntegrationTests GrpcData 39/39, Host 210/210, solution build clean. Not yet run on the gRPC data rig (rides #915).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#960