@@ -904,10 +904,10 @@ serializer How to serialize the final payload ``Redis::SERIALIZER_PHP`
904
904
905
905
At some point you'll likely want to scale the number of workers working on your queue.
906
906
Make sure you assign the correct ``consumer `` and ``group `` values in that case.
907
- The more likely case is thateach workershall work on the queue independently, reducing
907
+ The more likely case is thatyou want every workerto work on the queue independently, reducing
908
908
the time needed to process the pending messages. In that case, every single worker
909
- must have a different ``consumer ``configuration value. When working with Docker
910
- containers one idea might be to use the ``HOSTNAME `` environment variable:
909
+ must have a different ``consumer ``option value so Redis can identify the different workers.
910
+ When working with Docker containers one idea might be to use the ``HOSTNAME `` environment variable:
911
911
912
912
..configuration-block ::
913
913
@@ -923,6 +923,16 @@ serializer How to serialize the final payload ``Redis::SERIALIZER_PHP`
923
923
That means messages would be processed multiple times. In that case, you must have different ``group ``
924
924
configurations.
925
925
926
+ ..caution ::
927
+
928
+ Be careful when using the ``HOSTNAME `` environment variable in orchestrated environments such as Kubernetes or
929
+ Docker Swarm. It usually contains a random unique identifier which means if you destroy a container while it was
930
+ working on a message, this message will remain in pending state forever as it is very unlikely there's ever going
931
+ to be another worker with exactly the same ``HOSTNAME `` as the one you destroyed. In other words, you have to make
932
+ sure you're using deterministic ``HOSTNAME `` values such as ``worker-1 ``, ``worker-2 `` etc.
933
+ In case you are using Kubernetes to orchestrate your containers, consider using a ``StatefulSet `` rather than
934
+ a ``Deployment `` for example.
935
+
926
936
In Memory Transport
927
937
~~~~~~~~~~~~~~~~~~~
928
938