Menu

Your Laravel queue can lose jobs without an error: Redis eviction explained
📰

Your Laravel queue can lose jobs without an error: Redis eviction explained

DEV Community: redis·Amjad Iqbal·11 days ago
#TFmjO3qH
#devtoredis#devto#dev#redis#laravel
Reading 0:00
15s threshold

Some Laravel problems leave no trace. This is one of them.

The setup that bites

Many apps run the cache, the queue and the sessions on one Redis server. If that server uses maxmemory-policy allkeys-lru, Redis is allowed to delete any key under memory pressure, including the list that holds your queued jobs. There is no exception, no failed job and no log line. Your memory graph looks healthy because it does not know which keys belong to the queue.

There is a second trap. php artisan cache:clear runs FLUSHDB, so if the cache and the queue share a Redis database, clearing the cache also empties the queue.

What I built

Laravel Redis Advisor reads your cache, queue, session and Horizon configuration to learn which Redis connection holds what.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.