Performance: Job retries and failure
MEDIUM IMPACT
This affects backend job processing speed and resource usage, indirectly impacting frontend responsiveness and user experience.
public function handle() {
try {
// job logic
} catch (\Exception $e) {
$this->release(30); // retry after 30 seconds delay
}
}public function handle() {
try {
// job logic
} catch (\Exception $e) {
$this->release(0); // immediate retry without delay
}
}| Pattern | CPU Usage | Queue Pressure | Retry Delay | Verdict |
|---|---|---|---|---|
| Immediate retry on failure | High (CPU spikes) | High (queue congestion) | None | [X] Bad |
| Delayed retry with backoff | Moderate (smoothed spikes) | Moderate (spaced queue) | Yes (e.g., 30s) | [OK] Good |
| No failure handling | Wasted CPU on doomed jobs | High (retries continue) | N/A | [X] Bad |
| Failure logging and alerting | Efficient CPU use | Low (stops retries) | N/A | [OK] Good |