Skip to content
Calcrivo

Workspace Size Calculator

Estimate total disk space consumed by Jenkins agent workspaces from repository size, build output, and dependency caches.

Inputs

agents

Number of agents each holding a copy of the workspace.

MB

Checked-out repository size (working tree, not full git history unless cloned shallow=false).

MB

Size of compiled artifacts/build directories left in the workspace.

MB

Size of downloaded dependencies (node_modules, .m2, pip cache, etc.) per workspace.

Total Workspace Storage

9.766GB

Per-Agent Workspace Size

1,000.0MB

Dependency Cache Share

50.0%

Step by step

  1. Per-agent workspace = repo + build output + deps

    300MB + 200MB + 500MB

    = 1000.0MB

  2. Total across agents

    10 × 1000.0MB

    = 10000.0MB (9.77GB)

How it works

Each Jenkins agent that checks out a job maintains its own workspace on local disk containing the repository, any build output left behind, and downloaded dependencies — and because workspaces aren't shared across agents by default, the same job's workspace footprint is effectively duplicated on every agent capable of running it. Total fleet-wide workspace storage is therefore the per-agent footprint multiplied by agent count, with dependency caches (node_modules, Maven .m2, pip/conda caches) very often the single largest contributor.

Formula

totalWorkspace = agents × (repoSize + buildOutput + depsCache)

A
Number of agents
R
Repository size in MB
B
Build output size in MB
D
Dependency cache size in MB
W
Total workspace storage in MB

Frequently Asked Questions

Why do dependency caches dominate workspace size so often?

Package ecosystems like npm/Maven/pip resolve full transitive dependency trees onto disk, and unlike source code these caches often include many versions or unused transitive packages, routinely dwarfing the actual application source and build output.

Does 'Wipe out workspace' before each build help disk usage?

It frees disk between builds but increases build time, since dependency caches and incremental build state get discarded too — most teams instead clean build output between builds while persisting dependency caches to balance disk usage against speed.

How can I reduce per-agent workspace size?

Use shallow git clones instead of full history, route large dependency caches to a shared network cache or artifact proxy (e.g. a local npm/Maven mirror) instead of re-downloading per agent, and clean build output directories after archiving artifacts.

You might also need