Forum Moderators: phranque

Message Too Old, No Replies

Apache load balancing across sub nets

Apache load balancing

         

wintermute

2:49 pm on Oct 19, 2007 (gmt 0)

10+ Year Member



Hello all,
I'm new on here and a novice at Apache web server stuff. My group recently purchased two servers to support our growing code base of web applications. We want to use the cpu power of both machines by load balancing. Originally they were going to be located in the same physical data center but that has changed. They will be in different data centers and on different sub nets as a result. What would you recommend as the best way to achieve this load balancing across sub nets? Thanks in advance.

jdMorgan

6:22 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are many ways to do this, all with advantages and disadvantages. You can do it with round-robin DNS, or have one of the servers reverse-proxy some of the requests it receives over to the other server. If possible, I'd recommend the former approach, which is what Google uses, for example.

Jim

wintermute

9:38 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



Thanks for responding! We do a lot of cgi scripting. I've read that DNS round robin doesn't handle session persistence very well. This is a problem as we've typically on been on one server and now as we drill down through charts and what not we'll be hosed by the round robin mechanism. Is this true or am I not understanding it correctly?

jdMorgan

9:45 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, sessions -- Yes, that complicates things enormously.

How about some outside-the-box thinking then? Have you considered serving all the "pages" from one machine while serving images, CSS, external JavaScript files, and other session-independent resources from the other? You could do this by using a different subdomain or domain for these resources (as illustrated by the WebmasterWorld logo at top left this page), or again, by reverse-proxying those requests from the 'main' server to the 'resource' server.

This eliminates the need to implement an inter-server communication mechanism to synchronize/maintain the session data between the two machines.

Jim