This repo ships a profiling harness under cmd/profile that exercises push/pull
paths and emits CPU, fgprof (wall clock), and trace profiles. The harness is
guarded by the profiling build tag.
- Go toolchain installed (use the same
gobinary throughout your run). - Docker credentials available (e.g.,
docker login).- The client reads Docker's credential chain from
~/.docker/config.json(or$DOCKER_CONFIG/config.json). - DockerHub creds stored under
https://index.docker.io/v1/are supported.
- The client reads Docker's credential chain from
Run a pull with CPU profiling and view the web UI:
go run -tags=profiling ./cmd/profile \
-mode pull \
-profile cpu \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest
go tool pprof -http=:0 profiles/cpu_pull_*.pprofRun a push (no profiling) and just measure the timing:
go run -tags=profiling ./cmd/profile \
-mode push \
-profile none \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest \
-payload tmp/profiledataProfiles are written to profiles/ by default. Each run creates:
cpu_*.pprof(CPU profile, if-profile cpu)fgprof_*.pprof(wall-clock profile, if-profile fgprof)trace_*.out(execution trace, if-profile trace)heap_*.pprofandallocs_*.pprof(always written after the run)
File names include the mode, label (if set), and a timestamp.
# Cold cache
go run -tags=profiling ./cmd/profile \
-mode pull \
-profile fgprof \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest \
-cache-dir tmp/profilecache \
-clear-cache \
-unique-dest \
-label cold
# Warm cache
go run -tags=profiling ./cmd/profile \
-mode pull \
-profile fgprof \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest \
-cache-dir tmp/profilecache \
-unique-dest \
-label warmgo run -tags=profiling ./cmd/profile \
-mode pull \
-profile cpu \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest \
-repeat 20 \
-unique-dest \
-label repeat20go run -tags=profiling ./cmd/profile \
-mode pull \
-profile fgprof \
-ref ghcr.io/meigma/blobber/profiling/profiling:latest \
-descriptor-cache \
-repeat 10 \
-unique-dest \
-label desc-cachego run -tags=profiling ./cmd/profile \
-mode pull \
-profile cpu \
-ref localhost:5001/your/repo:tag \
-insecureInteractive terminal:
go tool pprof profiles/cpu_pull_*.pprofWeb UI:
go tool pprof -http=:0 profiles/cpu_pull_*.pprof
go tool pprof -http=:0 profiles/fgprof_pull_*.pprofCompare two profiles:
go tool pprof -diff_base=profiles/cpu_before.pprof profiles/cpu_after.pprofgo tool trace profiles/trace_pull_*.out-refFully qualified image reference (overrides-registry/-repo/-tag).-registry/-repo/-tagComponents to build a reference when-refis unset.-modepush,pull, orboth.-profilecpu,fgprof,trace, ornone.-outOutput directory for profiles (default:profiles).-labelLabel suffix for output filenames.-repeatNumber of iterations.-unique-destCreate a unique pull dir per iteration (avoids overlap).-payloadDirectory to push (push mode).-pull-dirDestination root for pulls.-cache-dirEnable the blob cache at the given path.-clear-cacheRemove cache dir before running.-lazyEnable lazy loading (cache-only).-prefetchEnable background prefetch (cache-only).-descriptor-cacheCache resolved layer descriptors in-memory.-insecureUse HTTP (local registries).-log-leveldebug,info,warn,error.-cache-statsPrint cache file stats after the run.-timeoutOverall timeout for the run.
- Auth failures: ensure
docker loginhas been run and the Docker config is readable from$HOME/.docker/config.jsonor$DOCKER_CONFIG/config.json. - Go toolchain mismatch: make sure the
gobinary andGOROOTare aligned (common when using goenv or multiple Go installs).