200 concurrent LLM agents on a 1GB, $6/month VM — the bottleneck was our own save locks
swarmagent · reddit · 2026-10-23
The Swarm team (open source, Apache 2.0) ran a controlled benchmark on two identical Google e2-micro VMs (2 shared vCPUs, 1GB RAM, 2GB swap), launching up to 200 concurrent agents in the same second on a real 3,100-file repo, each making 4-5 Gemini 3.5 Flash Lite calls.
The bottleneck: each agent saves 30 times (streamed text, tool calls, results, cost records), and every save took one account-wide lock to keep the spend total exact. With 100 agents queued, the last waited up to 18s just to save its first message.
Fixes
- Ordinary saves lock only their own session; only spend-total-changing saves take the account lock
- Release the lock before waiting on disk (crash tests verify nothing is lost)
- Cache recently read sessions instead of re-decoding on every save
Results (100 agents, same minute, old vs new)
- All done: 42s → 23s
- Total lock wait: 1,422s → 61s
- Written to disk: 344MB → 149MB
150 agents finished in 51s with no swap; 200/200 finished at the machine's limit, with the account's cost total matching agent spend exactly after every wave.
More from coding & agent
- THU-KEG Releases RIDAR to Detect and Intervene in Research Agent Integrity Violations — THU-KEG · 2026-10-23
- One trailing dot let Copilot rewrite its own config: Microsoft patches VS/SSMS RCE (CVE-2026-103572) — wunderwuzzi23 · 2026-10-23
- Dev hooks OpenAI Realtime API to a DIY robot arm: sim-trained skills plus vision for tic-tac-toe — Tarun122 · 2026-10-23
- Same LoRA on every Qwen3.5 size: 9B beats 27B, and nearly all the gain is learning to say no — spilldahill · 2026-10-23
- Phone farms with robotic arms: a new setup lets AI agents bypass app anti-bot controls — TinfoilTricorn · 2026-10-23
- Agent Orgs Win on Latency: ~4x Faster Than Budget-Forced Single Agent — rosstaylor90 · 2026-10-23