Skip to content

perf(transport): make the message channel capacity configurable#160

Open
SVilgelm wants to merge 1 commit into
rust-mcp-stack:mainfrom
SVilgelm:perf/configurable-stdio-channel-cap
Open

perf(transport): make the message channel capacity configurable#160
SVilgelm wants to merge 1 commit into
rust-mcp-stack:mainfrom
SVilgelm:perf/configurable-stdio-channel-cap

Conversation

@SVilgelm
Copy link
Copy Markdown
Contributor

📌 Summary

The incoming-message channel used a hard-coded capacity of 36, which is fine for request/response stdio but causes head-of-line jitter under bursty traffic. The capacity is now configurable via TransportOptions::channel_capacity (default unchanged), threaded through MCPStream::create/create_with_ack. Slow SSE clients continue to be handled by the existing ping interval.

🔍 Related Issues

✨ Changes Made

  • Add TransportOptions::channel_capacity (default DEFAULT_MESSAGE_CHANNEL_CAPACITY = 36).
  • Add a channel_capacity parameter to MCPStream::create/create_with_ack; stdio/SSE server transports source it from their options.
  • Add tests for the default and override.

The incoming-message channel used a hard-coded capacity of 36, causing head-of-line jitter under bursts. Expose it via TransportOptions::channel_capacity (default unchanged) and thread it through MCPStream::create.

Assisted-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Sergey Vilgelm <sergey@vilgelm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant