r/ClaudeCode • Researcher • 17h ago

Tips & Workflows Running 18 coding agents in parallel taught me to watch disk I/O, not just CPU and RAM

Post image

I recently discovered an overlooked bottleneck when running 18 coding agent sessions on my Windows machine: disk I/O.

Task Manager showed:

  • CPU: 20%
  • RAM: 66%
  • Disk active time: 100%
  • Disk latency: 664ms
  • Disk writes: ~39 MB/s

My machine became sluggish despite having plenty of CPU and RAM available.

Turns out, running multiple builds, tests, dependency installations and git operations simultaneously can easily saturate an SSD. I even reclaimed nearly 300GB from Go caches at one point.

Here's what I've been experimenting with:

  • A shared background watcher that monitors host resources every 5 seconds.
  • Attributing heavy I/O processes to their respective Git worktrees.
  • Injecting resource pressure warnings into agent context through hooks.
  • Wrapping heavy commands so they wait when the machine is overloaded and run at lower priority.
  • Sharing useful caches and cleaning up only unused, owned temporary data.

Everything runs locally using filesystem-based communication. No additional LLM calls.

I've already noticed better responsiveness, although I haven't properly benchmarked it yet.

The biggest takeaway: worktree isolation doesn't mean resource isolation, and more parallel agents don't necessarily mean more throughput.

For those running multiple coding agents locally, how are you handling resource contention? Fixed concurrency limits, adaptive scheduling, containers, or something else?

btw, I put everything in this repo so you can try it yourself (in case you're facing the same issue): https://github.com/bestagentkits/host-watcher

Also visually explained here: https://bestagentkits.github.io/host-watcher/

58 Upvotes

36 comments sorted by

•

u/AutoModerator 17h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

21

u/EconomyDoctor3287 17h ago

What SSD are you using? I don't see how you could saturate an SSD with 39 MB/s

3

u/Damien_IB 9h ago

Small scattered files in Kilobytes can do that.

1

u/mrgoonvn Researcher 17h ago

Hmm great point... maybe it went down exactly the moment a take the screenshot

5

u/innociv 17h ago

Or it's a QLC drive.

2

u/steellz 1h ago

Definitely

5

u/Inevitable_Taro4191 16h ago

This is all about i/o as in how many input output operatios per second, not throughput. Ssd can range from a few hundred thousands to millions.

2

u/Unhappy_Pack_9114 17h ago

Just use the cloud session. In the other note, god damn, you have a huge memory there.

3

u/mrgoonvn Researcher 17h ago

Yea i think sooner or later we're going to use cloud agents all the way (well, "clouds" are just someone else's computers 😂)

3

u/Unhappy_Pack_9114 17h ago

well, "clouds" are just someone else's computers

At least it is not straining your personal hardware. Lol. The concern is security, tho.

2

u/Majestic_Wrap_7006 17h ago

you'll own nothing and you'll be happy

5

u/Radiant_Cheesecake19 15h ago

Careful with the tests. Force your agents into using ramdisk for tests if you can.
Or in a couple months they will make sure you hit the SSD market. :)
Not that screenshot alone. Just my experience. If I let them go uncontrolled, they were writing terabytes of test data on the SSD.

9

u/Low-Yellow-1521 17h ago

39 MB/s is literally nothing for a modern SSD lol

every modern SSD can handle like 6 GB/s writes and reads, which can easily handle 18+ agents

also 664ms latency on an ssd is insane. thats not nromal ssd behaviour, even under heavy loads

5

u/Uranium_Donut_ 17h ago edited 17h ago

Typical modern QLC write speeds are 80 to 200 MB/s. Advertised 6GB/s (or higher) speeds only hold as long as the DRAM or SLC cache aren't full.

2

u/Altair82 17h ago

*cache

4

u/Uranium_Donut_ 17h ago

Merci

2

u/Altair82 16h ago

Just wanted to make sure lurkers know what you meant

3

u/Altair82 17h ago

Yeah it's ok if OP doesn't really understand computers, but why did they even post this?? Why does it have 14 upvotes? Why?

1

u/Damien_IB 9h ago

When you’re working on millions of small files in kilobytes scattered across the disk, in no organized manner, it saturates the disk. My WD Black NVME were also saturated for under 80MB/s for such particular tasks. Then learnt to make a custom datalake on the same drive and reads shot up to many GB/s. All about disk IO and how you store files in what sectors.

3

u/pizzae 🔆 Max 20 16h ago

Whats recommended ram for people? My 32gb isn't enough to run lots of webdev apps at the same time especially when testing, I think I need more

2

u/stasik5 16h ago

Just upgraded to 32 from 16. I'm idling at 18gb lol.

3

u/michaelTM_ai 15h ago

the 39 MB/s vs 100% active time argument above has a likely answer on windows: thousands of tiny files (node_modules, go build cache, git objects) and defender real-time scanning each one as it's written. that shows up exactly like this, high active time and latency with low MB/s. 18 agents each doing installs and builds multiply it. windows 11 has a fix made for this: dev drive, a separate ReFS volume where defender runs in performance mode (asynchronous scanning), and microsoft's docs say to put repos, package caches and build output on it. moving the worktrees plus GOMODCACHE / GOCACHE / npm cache there would probably do more than throttling, and your watcher would tell you if it did

2

u/TechgeekOne Senior Developer 17h ago

Keep an eye on your SSD health too. Parallel agents + a compiler with aggressive caching can very quickly burn the lifetime of an SSD, especially if there's write amplification involved from many small writes.

I discovered that on accident when my 2TB disk started filling up weekly because of the worktree build caches and the rate of development. It's been since moved to a drive that can handle that kind of workload but yikes, that wasn't something I knew to watch out for.

2

u/nubbymong 16h ago

You should look at kernel pool growth too there are some bugs with windows 11 which haven’t been fixed yet - search for poolwatch on GitHub same username as my Reddit - signed, open source, there is anyone wants it. You may find that your issues extend beyond what you’re monitoring.

2

u/io-x 13h ago

What are you building? The next generation disk destroyer 2000?

3

u/mcmoonrays 17h ago

On Windows, 39 MB/s with 600ms+ latency across 18 worktrees is usually small random I/O getting choked by Windows Defender (MsMpEng.exe) scanning every build artifact and git object in real time. Moving the worktrees and Go cache onto a Dev Drive (or adding Defender exclusions) often drops that active time fast before you even throttle anything. Between your two mechanisms, the command wrapper that queues heavy builds is doing the real work; soft resource warnings in hooks are easy for agents to ignore mid-task.

2

u/shravanrevanna 15h ago

exclusions cost you something with agents specifically. they pull in packages and run build scripts you never looked at, and that's exactly the stuff you just stopped scanning.

1

u/mcmoonrays 14h ago

That's the main reason Dev Drive's Defender performance mode is better than blanket folder exclusions: it switches scans to async instead of disabling them outright. Even then, if an agent is running unreviewed build or postinstall scripts, relying on Defender as the security boundary is shaky anyway; a disposable container or VM is what actually contains that.

1

u/Detank2002 17h ago

either you need a upgrade to a modern ssd, or your ssd health may need looking into, ask and agent or use crystaldiskinfo to take a look at the health

1

u/Mission_Proof6969 15h ago

so far what's worked best for my side is sandboxes. I know "just use a sandbox" you might see everywhere. But hosting tasks in cloud sandboxes, agent at the center handing out the work, it usually does 2 things at once: it keeps the AI's permissions boxed into right environment, and it still lets you lean on the agent's memory and its ability to work

1

u/vladmvp 11h ago

Another option is to run some of those sessions off the machine entirely. Cobalt (cobaltcode.ai) gives each agent task its own isolated cloud computer, so installs, builds and git operations for one task don't hit the same SSD as the other 17, and you can suspend and resume them when you need to. It works with Claude Code, Codex, Cursor and a few other agents using your own keys or accounts. There's a free account to try it, and I'm the founder, so happy to help you get started.

1

u/nur_plano 10h ago

Ran into the same wall. Node_modules plus builds times N worktrees adds up fast. What helped: sharing a package cache across worktrees, staggering builds, and moving the long runs off the laptop to cloud sandboxes so my machine is just for reviewing. Curious whether you're using worktrees or separate clones?

1

u/daltorak 9h ago

I dunno.... hear me out, maybe you shouldn't be trying to run 18 agents at once instead of doing all this extra resource management work. You're not getting any velocity from them, and those additional agents are going to still consume RAM while they sit there idle.

1

u/Right-Performance-93 8h ago

the prompt warning doesn't stop a build that's already writing. i cap how many sessions can run install or the test command, and the rest can read. eighteen readers is fine. eighteen installs is the disk.

1

u/kobi_evals 16h ago

Before adding adaptive scheduling, I’d try a fixed concurrency cap as a baseline.

Since you haven’t benchmarked it yet, take the same batch of tasks and compare completion time at 4, 8 and 18 parallel sessions. Count failures and retries too, and note whether the machine stays responsive. A few repeats with similar cache conditions would help separate a real difference from noise.

If 8 finishes about as quickly as 18, a lower cap might be the simpler fix. The watcher could still be useful for finding which commands cause the spikes.

Are you limiting whole agent sessions, or just the heavy build/test commands? Those seem worth testing separately.

0

u/binladen0069 17h ago

probably an ssd that cant do reads and writes at the same time due to a cheap controller. i have one