Skip to content

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

Open
SVilgelm wants to merge 4 commits 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 4 commits 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>
Copilot AI review requested due to automatic review settings June 5, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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.

3 participants