1
votes

Whats the best way to do load balancing on rails app, for a non aws setup? Nginx/Haproxy seems currently the best option.

2 node setup, one node also has haproxy on it

Load balancer: nginx listens on port 80/443 and proxy_forwards to haproxy on 8080 on the same server to load balance between the multiple nodes.

Nodes: nginx on the node listens to requests coming from haproxy on 8080 and processes it accordingly Vinny

1
why haproxy when you already have nginx, nginx can load balance too.Mohammad AbuShady

1 Answers

0
votes

Setup haproxy on the top layer rather than on a shared node. It will help you to manage in case you are looking to point your application with an IP. Load will be shared at the top layer as compared to shared node with haproxy configuration. Haproxy server will never experience load when present on a independent setup.