Experimental and env-gated (defaults off — stock behavior unchanged).
Read path is made fully non-blocking on both sides so neither the worker
nor the server waits on the stage behind it:
Postgres -> [server-side buffer] -> HTTP -> [agent-side buffer] -> worker
- batch pull/complete: N jobs per pull, N completions per flush, so the
per-job HTTP round-trips and per-job dequeue queries are amortized
- server-side prefetch: a single background puller per job-tag-set runs
the SKIP LOCKED dequeue ahead of demand and coalesces concurrent agents,
moving the PG query off the request critical path
- agent-side prefetch: a background refiller keeps the local job buffer
deep (high low-watermark + several refills in flight) so the worker
loop pops without a network call
- empty-pull backoff fix: don't apply the idle long-sleep to a transient
empty pull from a prefetching consumer
- AGENT_PROF: per-phase profiler + auto-rendered per-job time-budget SVG
Single agent goes from ~2.5k to ~125k+ j/s. Multi-agent collapse is
reproduced but its root cause is still open (not established to be PG).
See benchmarks/agent_worker_scaling.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pin native-tls to <0.2.17 to avoid compilation error with
Protocol::Tlsv13 match exhaustiveness, and propagate benchmark
feature to windmill-api-agent-workers to fix argument mismatch
in pull() call.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>