BlogBenchmarksPerformanceturno

Eight agent sessions, six MCP servers: measuring what a shared gateway saves

An agent session that uses a local (stdio) MCP server starts its own copy of it, so memory grows with sessions before any tool is called. In the 2026-11-16 run, eight sessions took 3,163 MiB in 56 processes on their own and, behind one gateway, 847 MiB with every server running and 103 MiB while idle.

5 min read

View sourceFeed
Measured
MethodApple M3, 16 GB, macOS, Node 26.13

An agent session that uses a local (stdio) server starts its own copy of it: in the stdio transport, the client launches the server as a subprocess. Counting the whole process tree under each server, each session in the 2026-11-16 runs with installed binaries added seven processes: 28 with four sessions, 56 with eight.

The benchmark measures what that costs with six public servers and eight sessions, once with each session starting its own servers and once behind the gateway of turno, a tool for switching accounts in coding agents: one local process, mcpd, that every agent session reaches and that starts each MCP server once.

Memory with 8 sessions and 6 MCP servers

MiB · log scale · lower is better

Memory with 8 sessions and 6 MCP servers, in MiB, lower is better
ResultMiBVs. baseline
each session starts its own56 processes3,163baseline
turno, all servers running8 processes8473.7x less
turno, idle1 process10331x less

Each session runs initialize and tools/list on every server; memory is the sum of the RSS of every process involved, read from ps three seconds after the last session connected.

Env
Apple M3, 16 GB, macOS, Node 26.13
Runs
one run
Measured
Reproduce
On a log scale, since the idle gateway is about a thirtieth of the direct setup.

In that run, the one in the results table of Benchmarks, the gateway used 73% less memory while every server ran and 97% less while they were idle. In two eight-session reruns on 2026-11-30 the setups stayed apart: 2,879 and 2,751 MiB direct, 659 and 405 MiB through the gateway with every server running.

The setup

The script, bench/mcp-ram.mjs, installs six servers that start without an API key into a temporary folder, at pinned versions: @playwright/mcp 0.0.85, chrome-devtools-mcp 1.13.0, @modelcontextprotocol/server-filesystem 2.3.0, @modelcontextprotocol/server-memory 2.1.1, @modelcontextprotocol/server-sequential-thinking 2.1.1 and @upstash/context7-mcp 4.7.0.

It then measures three setups with simulated sessions:

SetupWhat runs
Directevery session starts every server over stdio, as a plain mcpServers entry does
turno, all servers runningone mcpd with an empty tool cache: each server starts once to learn its tools and stays up for every session
turno, idlemcpd restarted with the tool lists the first round cached: no server starts until a tool is called

The gateway runs in a throwaway HOME; the script never reads or changes your turno or agent configuration.

The 2026-11-16 files do not record the turno version. The 2026-11-30 files, committed with the fixed script, record turno 0.6.3, the load average, and the memory of mcpd and of each server with its child processes.

Four sessions against eight

The 2026-11-16 run:

SessionsDirectProcessesturno, runningProcessesturno, idleProcesses
41,410 MiB28692 MiB8101 MiB1
83,163 MiB56847 MiB8103 MiB1

In that run direct memory more than doubled from four sessions to eight, and the process count doubled exactly. Behind the gateway the count stayed at 8 and memory rose from 692 to 847 MiB; idle, it went from 101 to 103 MiB. That day's two four-session gateway runs differed by 52 MiB: 692 and 640 MiB, the second in the --npx run, which changes only the direct setup.

Where the gateway's memory is

The 2026-11-30 reruns split it. The eight processes are mcpd, five servers with one process each and chrome-devtools-mcp with two, as it has per copy when started from the installed binary. The machine was shared with other sessions. Every server running:

RunSessionsLoad, 1 minmcpdSix serversTotal
4-sessions491.3761 MiB348 MiB409 MiB
4-sessions-npx451.571 MiB594 MiB665 MiB
8-sessions884.6696 MiB563 MiB659 MiB
8-sessions-run-2859.2859 MiB346 MiB405 MiB

"Six servers" is the total minus mcpd. Each pair, near 400 and near 660 MiB, holds one four-session and one eight-session run, and every server was larger in the pair near 660 MiB. mcpd stayed between 59 and 96 MiB. At this noise level the reruns do not show growth from four to eight sessions, and most of the spread is in the servers.

What the numbers leave out

RSS counts a shared page once in every process that maps it, so these sums overstate real pressure for both setups.

The benchmark only starts the servers and lists their tools, which every session pays even if it never calls them. A server that opens a browser or indexes files uses much more memory once a tool runs.

A browser that one agent drives at a time should run as a shared server with exclusive = true, one Chrome per browser identity (a persistent Chrome profile that an agent drives); other servers that keep state per conversation can use scope = "session" (Scopes). Both give back part of the saving on purpose.

Each 2026-11-16 figure is one run, and the two eight-session reruns differed by 254 MiB through the gateway, so a difference of that size should not be read as a change.

What came after

turno-cli 0.2.0 made the cost visible on your own machine: turno mcp top shows each running server's memory with its child processes, and turno mcp savings compares mcpd and its servers with an estimate of the same sessions without the gateway.

The same release shortens the idle limit when memory is short: a shared server normally stops after 30 minutes without a call, and under memory pressure after idle_under_pressure, 5 minutes by default, or a quarter of that when the pressure is critical. As of turno-cli 0.6.4:

packages/turno/src/mcpd/pressure.tsTypeScript
export function effectiveIdle(idle: number, level: PressureLevel, underPressure: number): number {
  if (!(underPressure > 0) || level === "normal") return idle;
  const limit = level === "critical" ? Math.max(1, Math.round(underPressure / 4)) : underPressure;
  return Math.min(idle, limit); 
}

The limit only gets shorter, and false turns the feature off.

turno-cli 0.3.0 also stops a quiet session server under critical pressure while its session lives; the next call starts it again.

Run it yourself

These numbers come from one machine, and the script is written for macOS: it reads the machine's model and memory with macOS sysctl keys. The script on main opens its sessions the way the gateway expects since turno-cli 0.2.0 (pull request 215). Its SERVERS list is easy to edit, and turno mcp list shows what you run:

Shell
git clone https://github.com/wimo-dev/turno
cd turno
pnpm install && pnpm build
pnpm bench:mcp-ram --sessions 8 --out bench/results/mine.json
pnpm bench:mcp-ram --sessions 4 --npx

Sources