Running one MCP server per CPU core: restarts were the hard part, not scaling
Mailbox-MCP · reddit · 2026-10-10
A hosted email MCP provider details running one Node process per CPU core behind nginx. Four pitfalls: (1) dozens of idle streams from Claude/ChatGPT kept server.close() from finishing — now shutdown takes under 0.1s; (2) rejected connections triggered up to 47 retries per second, fixed by systemd socket activation so the kernel queues connections during restarts (200/200 requests survived a proof run), though rollback requires stopping the socket too; (3) the TS SDK handler ends when the client hangs up but tools keep running — count in-flight tool calls; (4) two copies refreshing the same OAuth token risks invalidgrant with rotating refresh tokens, fixed with sticky nginx routing plus a token re-read retry. Their busiest hour only uses 10% of the event loop.
More from coding & agent
- Claude Code Pushes Urgent Security Update Across All Installations — umeshonai · 2026-10-23
- Claude cut a 2.6-hour video export to 20 minutes — but only after being told to rebuild the server — byhewar · 2026-10-23
- 3 flight-booking rules my AI agent checks that I'd never do by hand — Efistoffeles · 2026-10-23
- OpenJet claims Qwen3.8-27B coding runs 1.9x faster than llama.cpp on one RTX 3090 — JeremyCMorgan · 2026-10-23
- Building an autonomous SEO agent in Hermes with three skills: programmatic pages, Keywords Everywhere, DataForSEO — EXM7777 · 2026-10-23
- Building a sports betting AI agent with onchain execution and human approval by default: architecture and lessons — Dry-Comfortable-2678 · 2026-10-23