Load balancing

Giganews Newsgroups
Subject: Load balancing
Posted by:  Stefanie Erteld (Stefanie.Erte…@aol.com)
Date: Sun, 05 Jul 2009

Hi,

I am a Java programmer who is interested in some more Details about
Server's like Apache and / or Tomcat, in a high traffic environment.

1) How exactly does load balancing work?
I thought about it myself, and came to the conclusion,
that however it might be configured, at the first point
there can only be one single server, as when they do the
DNS they must connect an IP to the url.
I've heard that there is something like dynamic DNS, though -
1.1) How exactly does dynamic DNS work?
I've heard that somehow the entries in the DNS table will get rewritten
every milli or whatsoever second.
Even if there is something like dynamic DNS, than ok, then in this case
it's the DNS Server, which can only be one single server, so this one
server could be very easily brought down by a denial of service attack,
right? I mean a single pc that would be as fast as the first server that
  is contacted in a tree of maybe thousands of pcs in a load balanced
environment, such a pc would be enough to bring the entire system down,
right?

2) What about Session and load balancing?
I've heard there are differen strategies:
a) The Loadbalancer will always send the same session to the same server
=> easy but not as powerfull
b) The session is stored on a database
=> easy, but then the database will be the bottle neck
c) The session is somehow transferred from server to server
No idea how that could work, and there must be quite some overhead for
the transfer of the session data, hm?

3) Are there different strategies in load balancing?
a)I guess one strategy could be that the load balancer forwards the
request to another server, and this server then send the answer back to
the load balancer
+ might be more secure
- Load balancer would be the bottle neck of the entire server tree structure
b) Another strategy could be that the first request will be send to the
load balancer, which then send back an answer to the client to instead
directly request another server.
+ More performance
- System is way more open to attacks

Also, I was thinking, there must be a router anyway, which basically is
a server anway, so maybe if they could do the load balancing right in
this router, that could be more efficent - or would it be affordable
that each pc in line would have it's own seperate connection (and
firewall and so on) to the internet?

4) I've heard once it was more efficient to use an Apache server for
static content and a Tomcat server behind it for the dynamic content.
But would't this forwarding cost a lot of overhead? I am just reading a
book about Tomcat and it says Tomcat might be just as efficent as
standalone, or maybe even more - but it only said it "MIGHT". What do
you think - does it make sense / is it faster to have to have an apache
AND a Tomcat or would you just recommend Tomcat on it's own (using the
same amount of hardware!!!)

Would be nice if you could bring me some light into my confusion! ;-)

Thanks,

Stefanie

Replies