https://platformengineering.org logo
#general
Title
# general
z

Zoran Radovanovic

02/10/2023, 5:12 PM
Has anyone had experience implementing load balancing solution for RabbitMQ or Redis cluster using Nginx or HAProxy? What would be your preferred choice for a LB, Nginx or HAProxy and why?
d

David L

02/10/2023, 7:29 PM
Nginx can only do web/http traffic as far as I know. HAProxy can do many protocols. I don't know what protocols RebbitMQ or Redis use off the top of my head.
z

Zoran Radovanovic

02/10/2023, 7:48 PM
@David L thank you for the feedback.
c

Clemens Jütte

02/13/2023, 12:27 PM
Don’t try to load-balance in front of Redis for any other reason than geo-redundant HA failover. If you need high-performance beyond what Redis OSS can offer, then your best bet is to for Redis Enterprise, that is able to handle that Redis internally for you - while providing the single-node Redis interface and as such zero hassle for your devs.
Disclaimer - I worked for Redis and might be prejudiced. I can talk freely now, so this is my personal opinion. Happy to have a virtual coffee on the topic if that would help.
Rabbit also is a system that is running on top of Erlang and providing inbuilt ways to scale to a massive extend. It is unclear what you want to achieve, that makes putting a LB layer in front your architectural weapon of choice. Can you elaborate?
z

Zoran Radovanovic

02/14/2023, 6:40 PM
@Clemens Jütte thank you the feedback. The main reasons why I would like to use LB in front of RabbitMQ and Redis cluster is to decouple client apps from RabbitMQ and Redis infrastructure and to distribute load across all nodes in the cluster. I am not yet sure how would load distribution work with LB in front of a RabbitMQ cluster because, by default, all requests are handled by the primary node. Regarding Redis cluster I already have proof of concept implemented that distributes read requests to all nodes in a cluster. In case of write requests they would be distributed to primary nodes only. Unfortunately Redis Enterprise is not an option for me.
c

Clemens Jütte

02/14/2023, 8:36 PM
@Zoran Radovanovic since you keep saying cluster, I guess you’re running an instance of this here for Redis OSS cluster: https://redis.io/docs/management/scaling/ That would normally translate into a strategy of sharding your keyspace in an elegant way to distribute your data across nodes. A cluster-aware client will discover that topology automatically and communicate with the right nodes to access the data they contain. In that scenario the introduction of a LB makes almost no sense. But what you’re stating as a test scenario makes me believe you’re running a Sentinel setup - which is no cluster. I am confused 🙂
z

Zoran Radovanovic

02/14/2023, 9:46 PM
Thank you @Clemens Jütte. I agree with you that a client library with cluster-aware support would be enough to utilize all nodes in a cluster. I am just evaluating different architectures, I am not running Redis cluster in production yet.
165 Views