Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to learn about load balancing with servers.

Is there a way that I could simulate many servers in my machine and configure Apache for the load balancing? This is: see how it works live.

I just have one machine and no possibility to go to a lab :/

share|improve this question

closed as not a real question by Wesley, Magellan, EEAA, RobM, mulaz Oct 28 '12 at 23:19

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

You'd either need enough hardware to simulate identical VMs and tinker around with it (doesn't sound like you have this), or you'll have to do rough paper calculations based on the information you have available. Even in case 1, a lab environment isn't the same as a production environment, and may not give accurate results. – Bigbio2002 Jun 14 '12 at 19:32
I would like to test small things, just to see how it works. Is there a way that I could do that – Kani Jun 14 '12 at 19:36
What is the base for the load-balancer? IPs? Sessions? MACs? – Nils Jun 14 '12 at 21:14
I believe that IPs in terms that you redirect the load to a server -could be the same IP with different port-. AJP manage sessions, and you could force that the server resolve the request of a session -with sticky session- (…). Please, if I'm wrong correct me! I want to test in the wire, and don't know how to start :/ – Kani Jun 14 '12 at 21:18

Kani, I am doing exactly the same as you at the moment.

I installed VirtualBox on my PC, then I created a new Virtual Machine and installed CentOS on it. I configured the networking to be bridged so it has a visible network address to other devices on the network. I installed the applications I needed specifically Apache HTTP.

Afterwards, I shutdown the virtual machine then fully cloned it with a new MAC address 2 times to create 2 more machines exactly the same. As they have different MAC addresses they all pick up different network addresses from the DHCP server. Our DHCP server gives the same address out to the same machines so as long as you use the virtual machines regularly then they'll keep there addresses so you won't have to organise static addresses from your network administrator.

It was quite easy and only took a few hours to set up.

share|improve this answer

just make apache listen on different ports with different vhosts listening on each.

if you want to test failover use iptables to block access to some of them. if you want to check for session stickiness check logs for each of vhosts.

but... in fact you might be better off creating few virtual machines and having 'closer to real' setup.

share|improve this answer

If you want to do some testing, install some virtualization software, create some VMs with the software/OSes you want to use, and play around with them. Note that you'll need plenty of RAM for this.

share|improve this answer

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