mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-22 16:06:27 -05:00
Reset hill-climb warmup after idle period to re-seed EMA
When throughput dropped to zero, the monitor reset direction and decline_streak but not warmup_samples. On resumption, the first meaningful throughput sample was compared against a stale pre-idle EMA value, which could cause the hill-climber to make a scaling decision based on a meaningless delta (new throughput vs. zero-decayed EMA from potentially minutes ago). Reset warmup_samples to 0 in the idle branch so the EMA is re-seeded from two fresh samples before the hill-climber acts. This ensures the first scaling decision after an idle period is based on current throughput trends rather than stale history. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
47a097ee96
commit
1dd979f955
1 changed files with 4 additions and 1 deletions
|
|
@ -584,11 +584,14 @@ ThreadPool::monitor_routine(void *arg_)
|
|||
// Only adjust if there's meaningful work happening.
|
||||
// Reset direction to +1 (bias toward growth) so a stale
|
||||
// shrink direction from before the idle period doesn't
|
||||
// penalize the pool when work resumes.
|
||||
// penalize the pool when work resumes. Also reset warmup
|
||||
// so the EMA re-seeds from fresh samples rather than
|
||||
// comparing against a stale pre-idle value.
|
||||
if(ema_throughput < 0.5 && prev_ema < 0.5)
|
||||
{
|
||||
decline_streak = 0;
|
||||
direction = 1;
|
||||
warmup_samples = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue