• 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.

            Assignee:
            Unassigned
            Reporter:
            Igor J Konopko (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: