-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Networking, Performance
-
None
-
Networking & Observability
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
CommonAsioSession::sourceMessage() reads every message with two recv() calls: the 16-byte header, then the body whose length the header gives. For synchronous plain (non-TLS) sessions, after the TLS detection of the connection is done, sourceMessageWithReadAhead() reads up to kReadAheadBytes in one call, which normally returns the whole message. Bytes past the end of the message (only possible when a client pipelines requests) are kept for the next call; a message larger than the buffer is completed with an exact read of the remaining bytes. isConnected() and waitForData() treat buffered bytes as pending input, after the POLLRDHUP disconnect check. The first message of a connection takes the existing path, so TLS detection is unchanged. The physical bytes-in counters, including the connection-purpose (replication) counters, are updated as before.
Measured effect
- YCSB workload B (95% read, 5% update): instructions/op -1.4%
- YCSB workload C (100% read): instructions/op -1.8%
YCSB, single-node replica set, 5M documents in the WiredTiger cache; cycles and instructions per operation.
Risk
Only synchronous plain-TCP sessions after their first message; TLS and asynchronous sessions are unchanged.
Tests
Extends asio_transport_layer_test.cpp with pipelined messages (including one larger than the read-ahead buffer) and a message whose header arrives in two pieces.
- is related to
-
SERVER-130904 Connection deadlock via buffered pipelined requests on priority TLS-handoff sessions
-
- Closed
-
-
SERVER-90544 Investigate reducing cost of OperationCPUTimer
-
- Closed
-
-
SERVER-81784 Pass MSG_WAITALL to send/recv when doing sync networking
-
- Closed
-
-
SERVER-83303 Attempt to read whole message in one go in sourceMessage
-
- Closed
-
-
SERVER-125097 Remove redundant per-request sched_yield in SessionWorkflow
-
- Closed
-