PDA

View Full Version : Load balancing at http layer in Spring


mingshun
Aug 29th, 2004, 03:44 AM
Hi everyone,

I have 2 app servers, namely A, B and 1 db server. I will also do away
with ejb and apply load balancing to A and B. Lets say if an insert
operation is being performed and at the same time A is heavily loaded,
B takes in this request and do the insert operation into the database.

Qn:
Will spring be able to detect this and informs A to ignore about this
request since B has already done the insert operation?

Thanks,
Meng Soon

Colin Sampaleanu
Aug 29th, 2004, 11:29 AM
I would personally stick to doing load balancing at the HTTP level. Basically new users come in, and get directed to either A or B, where they get a new Servlet Session, and from then on the Session affinity keeps them coming back to the same box.

While it's true this will not load balance for a user on every request, it's quite simple, and ensures that you don't have performance issues with transferring session data across a cluster for every request.

You can easily do this type of setup with Apache http server, sitting in front of an app server or servlet engine like TomCat, using an apache connector appropriate for the app server or servlet engine.