Commit 16ad47e
feat(redis-worker): per-env batched pop in MollifierDrainer
Adds a drainBatchSize option (default 1, preserves existing behaviour)
that lets the drainer pop up to N entries from each chosen env per tick
and dispatch them all through the shared concurrency-bounded limiter.
Org/env fairness is preserved — the per-tick env selection is
unchanged, only the in-env pop count grows. Wires
TRIGGER_MOLLIFIER_DRAIN_BATCH_SIZE through the webapp (default 50).
For a single-env burst of K entries with K > 1, drain time drops from
K × tick_time to ceil(K / drainBatchSize) × tick_time with handler
parallelism capped at concurrency. Heavy single-tenant tails go from
minutes to tens of seconds without changing PG load characteristics.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent eaae99e commit 16ad47e
6 files changed
Lines changed: 489 additions & 30 deletions
File tree
- .changeset
- .server-changes
- apps/webapp/app
- v3/mollifier
- packages/redis-worker/src/mollifier
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1104 | 1114 | | |
1105 | 1115 | | |
1106 | 1116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
0 commit comments