Prober: claim ahead of the lanes, not when they run dry
The next claim started at half a batch of four pipeline rounds a lane, 3-6 s of work, while a claim takes 1.5-4 s and more; at 20-24 lanes the lanes waited for candidates up to 19% of their time. queueLevels: the claim starts below eight rounds of every lane's pipeline (~13 s) and fills the queue to twice that. Taken candidates go back to waiting at start-up as before, so a bigger queue costs nothing on a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68b480c97e
commit
0ccb850ea4
2 files changed
+38
-3
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { test } from '@japa/runner'
|
||||
import { queueLevels } from '#services/prober'
|
||||
|
||||
test.group('Prober / queue levels', () => {
|
||||
test('the next claim starts with eight pipeline rounds of every lane still queued, and fills to twice that', ({
|
||||
assert,
|
||||
}) => {
|
||||
assert.deepEqual(queueLevels(22, 8, 400), { low: 1408, target: 2816 })
|
||||
assert.deepEqual(queueLevels(7, 8, 400), { low: 448, target: 896 })
|
||||
})
|
||||
|
||||
test('few lanes: at least the configured batch', ({ assert }) => {
|
||||
assert.deepEqual(queueLevels(2, 8, 400), { low: 400, target: 800 })
|
||||
assert.deepEqual(queueLevels(0, 8, 400), { low: 400, target: 800 })
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user