Laravel Horizon generating CROSSSLOT error with AWS Redis #43242
-
We are getting CROSSSLOT errors from time to time using AWS Redis. AWS Redis is just 1 node and 1 shard. We have redis defined in configu/queue.php: Redis in config/database.php:
Any suggestions on how we can avoid the CROSSSLOT error when using the AWS Redis? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Anyone ? |
Beta Was this translation helpful? Give feedback.
-
We managed to resolve it. We had to put the queue names in the horizon.conf in {} So as an example: You should make sure that all of them have {} in horizon.conf so as an example: 'prefix' => '{aaredis}:', |
Beta Was this translation helpful? Give feedback.
-
While it’s technically possible to globally prefix all keys with a shared hash slot to avoid CROSSSLOT errors, doing so would undermine the core benefits of clustering, including horizontal scaling and balanced distribution across nodes. We need another solution. Reviewing every Redis communication in the app and using slots properly. |
Beta Was this translation helpful? Give feedback.
-
Not all the jobs should end up in Redis. Redis is expensive and jobs could get trimmed silently if it is busy. The jobs might not need the performance that Redis provides. It would be great if Horizon could work with another DB like MySQL. |
Beta Was this translation helpful? Give feedback.
We managed to resolve it.
We had to put the queue names in the horizon.conf in {}
So as an example:
'queue' => ['{default}','{queue2}','{queue3}'],
You should make sure that all of them have {} in horizon.conf so as an example:
'prefix' => '{aaredis}:',