# Queue Timeout Analyzer
Category | Severity | Time To Fix |
---|---|---|
✅ Reliability | ⚠️ Critical | 2 minutes |
Class: Enlightn\Enlightn\Analyzers\Reliability\QueueTimeoutAnalyzer
# Introduction
This analyzer ensures that your queue retry value is larger than your queue timeout configuration value.
The queue timeout value must be at least several seconds shorter than the retry after configuration value. If this is not the case, then this can cause problems such as your jobs may be processed twice or the queue worker may crash.
# How To Fix
If you are not using Horizon, the default queue worker timeout is 60 seconds. So, your retry after value must be greater than 60 seconds. To change your retry after value, you may do so in your config/queue.php
file:
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
If you are using Horizon, then make sure that your retry after is greater than your timeout defined in your defaults
and environments
configurations (if no timeout is defined, it is considered to be 60 seconds):
'defaults' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'auto',
'maxProcesses' => 1,
'memory' => 128,
'timeout' => 90,
'tries' => 1,
'nice' => 0,
],
],
As above, the timeout is explicitly defined as 90 seconds, so your retry after value must be greater than 90 seconds. If not, then you may change the value in your config/queue.php
file as indicated above.