Why Redis for Queues#
AcelleMail uses Laravel queues to process campaign sends asynchronously. The default database driver works but creates heavy load on MySQL. Redis is an in-memory data structure store that handles queue operations significantly faster with minimal I/O overhead.
Install Redis on Ubuntu#
sudo apt update && sudo apt install -y redis-server
sudo systemctl enable redis-server
sudo systemctl start redis-server
redis-cli ping # should return PONG
Configure Laravel to Use Redis#
Edit /home/vbrand/app/.env:
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null
Then clear config cache:
php artisan config:cache
Run Queue Workers#
php artisan queue:work redis --sleep=3 --tries=3 --daemon
Use Supervisor to keep workers running:
[program:acellemail-worker]
command=php /home/vbrand/app/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
numprocs=4
user=vbrand
Monitor Redis Queue Depth#
redis-cli llen queues:default
redis-cli info stats | grep total_commands_processed
Install Laravel Horizon for a web-based queue dashboard — it natively supports Redis and gives real-time throughput metrics, failed job tracking, and worker management.