Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I only have two servers, both running nginx. What I can't figure out is how to load balance with just those. The tutorials I find are worded in a way that makes me think that I need a third server sitting in front of the two. Can anyone tell me how to make this work, or point me to something that will?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Even though the instructions you are seeing have a load balancing server with two nodes behind it on separate machines, you can double up on one box as the load balancer and 1 of the nodes.

ServerA:
nginx on port 80
web server of choice on port 5000

ServerB:
web server of choice on port 5000

All traffic requests hit ServerA on port 80, it in turn balances between the two web servers on ServerA and B.

This doesn't help you in terms of failover redundancy, you lose ServerA and everything goes away still, but does help regarding performance.

share|improve this answer
    
I've recently put just this system in place with two machines. –  Alister Bulman Jul 24 '10 at 16:06
add comment

I would say you either need a third (or some other type of load balancer, hardware or software) sitting in front or you need to split traffic between them via round robin dns or a similar method and then each can upstream proxy to the other if it's load is high, or whatever method you use to balance.

share|improve this answer
add comment

Round Robin DNS

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.