Performance: Job options (backoff, attempts, priority)
MEDIUM IMPACT
This concept affects how background jobs are scheduled and retried, impacting server responsiveness and throughput.
await queue.add('email', data, { attempts: 3, backoff: 5000, priority: 1 });
await queue.add('email', data, { attempts: 10, backoff: 0, priority: 1 });
| Pattern | CPU Usage | Memory Usage | Job Throughput | Verdict |
|---|---|---|---|---|
| Immediate retries with no backoff | High spikes | High | Low due to blocking | [X] Bad |
| Retries with backoff and limited attempts | Moderate and stable | Moderate | High and smooth | [OK] Good |