r/moderndotnet • u/pdevito3 • 21h ago
Comparing Background Job Library Performance Across .NET
I've seen some perf posts on background job libraries recently and wanted to dig into it a bit myself alongside my own BackWave package. Results below.
Setup: 7 libraries on one Postgres 17, the same 40 worker slots each, 5 rounds in rotated order, M1 Max with Postgres in Docker. So it's a local run. Look at the ratios more than the absolute numbers.
| Library | Drain noop (jobs/s) | Drain 10 ms (jobs/s) | Unpaced (jobs/s) | p50 @ 50/s (ms) | p50 @ 500/s (ms) |
|---|---|---|---|---|---|
| Acta | 14,695 | 3,004 | 5,770 | 7.8 | 6.4 |
| BackWave (opt-ins) | 13,875 | 2,661 | 7,602 | 5.5 | 5.6 |
| BackWave (4 groups) | 7,984 | 2,490 | 4,427 | 5.6 | 6.4 |
| BackWave (defaults) | 6,453 | 2,228 | 4,742 | 6.6 | 6.6 |
| Wolverine | 5,619 | 2,930 | 3,286 | 6.7 | 9.7 |
| MassTransit | 4,669 | 2,044 | 1,934 | 11.3 | 12.6 |
| Quartz.NET | 1,231 | 1,087 | 898 | 20.8 | 31.8 |
| TickerQ | 869 | 731 | 1,798 | 12.4 | 9.0 |
| Hangfire | 601 | 581 | 364 | 18.3 | couldn't keep up |
| JobMaster | 76 | 74 | 65 | couldn't keep up | n/a |
tl;dr
- Acta is the fastest at draining a backlog, on its default settings, with its audit log on. Even with my two opt-in settings, BackWave gets to about 0.94x. With BackWave's defaults it's roughly half. Acta writes about 127 completions per round trip, and that design is the inspiration for my own opt-ins. Absolute beast, well done u/Glittering_Welcome73!
- BackWave comes second in the drains and has the lowest median latency at a steady rate. Under unpaced load it builds a backlog, and Acta's p99 is better at 2k and 4k jobs/s.
- Latency clocks aren't the same for everyone. Acta, MassTransit, Quartz, and TickerQ stop at handler return. BackWave, Hangfire, and JobMaster stop later, at the durable success write, so the comparison leans against BackWave. At an equal 6k jobs/s, BackWave with opt-ins had p50 4.8 ms / p99 46 ms against Acta's 15 ms / 115 ms. Full details in the post below.
- Wolverine (6.67, Postgres queue transport) keeps up with Acta on 10 ms jobs and had the best p99 of the group at 50 jobs/s (13.9 ms). It's a message bus rather than a job scheduler, and it needs tuning for this: on its defaults it drains about 79 jobs/s (20 messages per poll, then a 250 ms pause). I ran it at 1,000 per poll, 4 listeners, a 25 ms poll, and LISTEN/NOTIFY on, picked from a grid. Every send goes through its durable outbox (about 9 ms per send here), so unpaced it tops out around 3.3k jobs/s.
- TickerQ 10.4.0 ran 3 to 13 jobs out of 20k twice under load, in every round, on its default settings too. The write-up shows the trace.
On JobMaster, since I know the docs show much bigger numbers: I don't think we disagree. Their headline 7k to 29k/s figures are scheduling rates across multiple worker containers. Their completion figures are in the tens to hundreds per second. JobMaster also pauses each slot 500 ms after every job on the Medium lane, by design. So 40 slots top out around 76 jobs/s, and that's what I measured. On the Critical lane I saw about 267/s. This table only counts completed jobs.
Full write-up with every setting, the method, and the caveats: https://backwave.app/docs/advanced/benchmark-results
The harness is public if you want to rerun it or tell me I configured your library wrong: https://github.com/Back-Wave/BackWave/tree/main/benchmarks