Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Measured 27,257 MCP Connections. The p90 Session Waits 35s.

In July I wrote a 56-line shell script called mcp-optional whose entire job was to remove two MCP servers from my config. Not fix them. Remove them. Both were stdio servers, so each one spawns its own Node process per session . With around 13 Claude Code sessions open on a 16GB M4, that was roughly 1.4GB of duplicated RAM, which meant swap thrash, which meant a hot laptop. Disabling them by…

In July, a developer created a shell script called mcp-optional to remove two standard input/output (stdio) servers from their configuration. These servers were causing memory issues by spawning their own Node process per session, leading to increased RAM usage and swap thrash. The developer disabled these servers by default and re-enabled them on demand, which resolved the memory problem.

However, upon reviewing the MCP connection logs left by Claude Code on the developer's laptop, they discovered that one of the two servers was not only causing a significant RAM tax but also the slowest connection point by a wide margin. The developer measured the connection latency over 35 days, analyzing 33,599 log files and 27,257 successful connection pairs across 22 servers.

While the median connection time appeared acceptable at 582 milliseconds, 39% of connections took longer than a second, with a worst-case scenario (p99) of 14 seconds. The issue was traced back to OAuth token refreshes, which added an additional 2.6 seconds to connection times despite the server's response time being only 550 milliseconds.

This was due to the client having to obtain a new access token during connection, which significantly impacted the overall connection speed. Another factor contributing to the slow connections was the use of stdio instead of HTTP transport, which was 3 times faster in the median but worse in the tail. The developer also noticed that multiple connections to different servers led to longer connection times, with a median of 8 servers connected simultaneously and a p90 of 35.5 seconds.

A significant 29.7% of connection attempts failed to establish a connection at all, with one integration being responsible for 7,422 of these failed connections. The developer capped their measurements at the client's declared 30-second timeout, removing a small percentage of slow connection samples that were unrelated to actual server issues.

Ultimately, the developer concluded that counting the number of servers before tuning them is crucial, with a median of 8 servers and a p90 of 35 seconds. Removing a mediocre server can significantly improve performance compared to optimizing a good one, and opting for heavy servers to be enabled only when necessary can lead to the highest leverage improvement.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Tailor a Resume to a Job Description in 20 Minutes

Most advice on this stops at "find the keywords and put them in," which is true, useless, and the reason people either burn an evening per application or give up and send the same file to everything.

  • Identify five key aspects of the job posting to tailor resume for (5 minutes)
  • Adjust summary, skills list, top 3 role bullets, and section order in 20 minutes
  • Rewrite top bullets using exact posting language while keeping facts unchanged

Can You Vibe Code an OS Without Lying to Yourself?

I have no idea what I'm f*cking doing. Something I have been chewing on: I am using AI agents to help build an operating system. And I genuinely cannot tell you yet whether that is a good idea.

  • ShrekOS boots, updates, and isolates agents.
  • AI agents work within defined framework.
  • Vibe coding operating system is potentially irresponsible.

More from Wednesday 16 September →