Laravel Horizon is coming, so I'm looking to switch my queues from beanstalkd to Redis to take advantage of better queue monitoring.
However, occasionally I have to perform php artisan cache:clear
. But if I do so, since my queue is now in Redis, it will wipe out all my jobs, as discussed in this GitHub issue.
The suggestion was to make a separate Redis instance. Here are my questions:
- How do I create multiple Redis server instances in my Laravel Forge managed server?
- What should I change in my config files so that session and cache point to one Redis server instance, and my queue points to a different Redis server instance? (now know the answer to this, see link in edit)
- Is it correct that
php artisan cache:clear
will now only wipe out data in the Redis instance that my cache is using, and my queue worker Redis server will not be affected?
Edit
Upon searching the internet further, I've come across this discussion.
- So I think I do not really need to create a separate Redis server instance, just use a different Redis DB number. Is this correct?
- Does
php artisan cache:clear
wipe out only that DB number? Other DB numbers on the same instance are not affected?