forked from tobi/delayed_job
-
Notifications
You must be signed in to change notification settings - Fork 954
Reschedule Times Table for 5s plus N^4
Eliot Sykes edited this page Nov 8, 2024
·
15 revisions
By default, DelayedJob reschedules erroring jobs in 5 seconds + N ** 4, where N is the number of failed attempts.
These figures assume: 1) the job always runs on schedule at run_at
and performs in 0 seconds. 2) your app has the default Delayed::Worker.max_attempts = 25
which is why the table says the job is not rescheduled for N=25
(check your app's Delayed::Worker.max_attempts
as it may be different).
Number of failed attempts N
|
Delay until next (N+1 ) attempt 5s + N^4
|
Cumulative delay after 1st attempt (~approximation) |
---|---|---|
1 | 6s | 6s |
2 | 21s | 27s |
3 | 86s | 113s (~2 mins) |
4 | 261s | 374s (~6 mins) |
5 | 630s | 1,004s (~18 mins) |
6 | 1,301s | 2,305s (~38 mins) |
7 | 2,406s | 4,711s (~1 hour) |
8 | 4,101s | 8,812s (~2 hours) |
9 | 6,566s | 15,378s (~4 hours) |
10 | 10,005s | 25,383s (~7 hours) |
11 | 14,646s | 40,029s (~11 hours) |
12 | 20,741s | 60,770s (~17 hours) |
13 | 28,566s | 89,336s (~1 day) |
14 | 38,421s | 127,757s (~1 day) |
15 | 50,630s | 178,387s (~2 days) |
16 | 65,541s | 243,928s (~3 days) |
17 | 83,526s | 327,454s (~4 days) |
18 | 104,981s | 432,435s (~5 days) |
19 | 130,326s | 562,761s (~7 days) |
20 | 160,005s | 722,766s (~8 days) |
21 | 194,486s | 917,252s (~11 days) |
22 | 234,261s | 1,151,513s (~13 days) |
23 | 279,846s | 1,431,359s (~17 days) |
24 | 331,781s | 1,763,140s (~20 days) |
25 | Job failed, is not rescheduled | - |