Nginx - Load Balancer Role

38 views
Skip to first unread message

Robbie Pallas

unread,
Oct 2, 2012, 8:43:19 AM10/2/12
to scalr-...@googlegroups.com
Hi,

I've created an nginx load balancer role using the role builder and added it to my farm. I've also created a services default configuration preset using the default settings provided by Scalr and attached it to the role.

I've been monitoring the load balancer while i have 2 instances of my application role (apache) running. All the requests i make to the LB are successful but the logs on the instances show that only one of them is receiving the requests. I figured requests coming from the same IP might be routed to the same instance, so i opened up a few ssh connections to some EC2 instances and hit the LB using curl. All the requests still went to the same instance.

I'm new to nginx, but i've been reading the online docs while looking through the nginx config on my LB and it appears to be configured ok. I've also monitored "/etc/nginx/app-servers.include" while launching and terminating app instances and confirmed that Scalr is correctly updating the file with instance IP's.

Can anyone suggest what i might be missing? Also, are there any better ways of testing a load balancer to ensure correct distribution of requests?

Thanks
Robbie




Robbie Pallas

unread,
Oct 8, 2012, 5:09:11 PM10/8/12
to scalr-...@googlegroups.com
After reading the scalr documentation a little more i discovered that disabling the ip_hash in /etc/nginx/app-servers.include forces the load balancer to distribute the requests evenly. This was pretty useful for testing.

I also made a few tweaks to the https file parameter to add in some redirects i've not got the load balancer working nicely.

Thanks
Robbie
Reply all
Reply to author
Forward
0 new messages