Search code examples
ruby-on-railsamazon-web-servicesscale

How to distribute the load of Rails app between AWS servers?


I want to distribute the load of few servers on AWS and my own home server, link DBs between them and make backup. I use REE, nginx and passenger. What are the ways to do this?


Solution

  • Setting up a load balancer is a common way to solve this. All requests go to the load balancer, which acts as a proxy and sends the request on to one of the nodes you want to distribute load for.

    If you want to set this up yourself I understand it is straight forward to spin up a small EC2 (or any other VPS) instance using nginx or similar.

    If you want a turn-key solution Amazon offers Elastic Load Balancing. Other ready-to-go solutions include Rackspace's Cloud Load Balancers. Probably best to go with Amazon since their ELB will have low latency connection to your EC2 nodes.