-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Worker count is currently a static flag defaulting to 3. On multi-core machines or varying I/O conditions the optimal count changes during a run. A runtime tuner makes the system self-optimizing.
Scope:
- Create
internal/tuner/tuner.gowith a background goroutine sampling throughput every 10 seconds - Track images/sec over a sliding window
- Scale workers up by 1 if throughput improved in last window and memory is below 60% threshold
- Scale workers down by 1 if throughput degraded or memory exceeds 70% threshold
- Respect min/max worker bounds (
-min-workers,-max-workersflags) - Log every scaling decision with reason
Example log output:
[Tuner] Scaled workers 3 → 4 (throughput: 6.08 → 7.21 img/s, memory: 42%)
[Tuner] Scaled workers 4 → 3 (throughput: 7.21 → 6.89 img/s, cause: diminishing returns)
Acceptance Criteria:
- Worker count adjusts automatically without restart
- Scaling decisions are logged with throughput and memory context
- Static
-workersflag still works, disabling the tuner - Benchmark comparison between static and adaptive modes documented in
BENCHMARKS.md
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request