size

Estimate worker counts from host memory and CPU.

julia --project=. -m DistSSHKit size [options] [parent] [child:NAME...]

Also: drive, pool, size --help. Flag vocabulary: User Guide.

Flags

  • parent: include this job's DistSSHKit parent (same token as go / drive; :N stripped)
  • --gb-per-worker N: assume N GB per worker instead of measuring RSS
  • --probe PATH: after package load, include this script on each probe worker and record peak RSS
  • --mem-headroom N: fraction of RAM usable for workers (default 0.75)
  • --parent-gb N: GB to reserve for the parent process (default 0.4)
  • -q / --quiet: hide terminal detail during measurement
  • --progress: live status (TTY default)
  • --verbose: full detail (non-TTY default)
  • -y / --yes: reserved (no prompts today; kept so shared CLI flags peel the same as go / drive / setup)
  • --hosts CSV: comma-separated SSH hosts (child:NAME:N → host name only)
  • --hosts-file PATH: append SSH hosts (child:NAME:N → host name only)
  • -v / --version: print DistSSHKit version and exit
  • -h / --help: full help

The CPU term prefers the OS core count: remotes use hw.ncpu (macOS) or nproc (Linux); the local host prefers hw.ncpu and falls back to Sys.CPU_THREADS when that query fails (typical when the local host is Linux). Parent hosts reserve 2 cores, children reserve 1. The formula does not change with the Julia minor. The estimate is a process count; it does not set --threads=auto or worker thread pools.

Drive preflight uses the same RAM fraction, parent_gb, and CPU reserve as size_worker_count (pipeline! / drive! / CLI drive --mem-headroom). RSS safety / floor / fallback stay unexported constants (not flags).

Remote project paths use the same resolution as drive (DISTRIBUTED_REMOTE_PROJECT_ROOT / setup remote root).

Measurement is a hint, not a job peak: baseline is package-load RSS; with --probe, peak is after that script runs. Worker counts use max(baseline, peak). Print a plan, then paste parent:N / child:NAME:N into go / ride / drive. Prefer --gb-per-worker when you know the workload. size! returns a WorkerPlan for drive!(session, …; plan=…).

DISTSSHKIT_JOBS (default 1) parallelizes Julia-path detection only; probe workers are still added one host at a time.

julia --project=. -m DistSSHKit size parent child:host1 child:host2
julia --project=. -m DistSSHKit size --probe warmup.jl parent

warmup.jl is ordinary Julia (top-level statements). Example:

# Allocate something representative of one worker's working set.
const _ = zeros(Float64, 10_000_000)