In our application, Server A establishes a TCP connection with Server B, then it sends a large amount of requests to Server B over the TCP connection. The request message is XML-based. Server B needs to respond within a very short period, and it takes time to process the requests. So we hope a load balancer can be introduced and we can expedite the processing by using multiple Server B's. This is not a web application. I did some research but failed to find a similar application of load balancer.

Can anyone tell me if there's a load balancer can help in our application?

A diagram illustrating our application:

enter image description here

  • Hmmm, I think a diagram of how your apps communicate might help us here. Even something crappy thrown together in paint would help. – Mark Henderson Mar 8 '11 at 23:26
  • Are you sure that all the data is transferred over the same TCP connection? You say there's a large amount of requests. Does this all definitely happen over a single connection attempt? – Lewis Mar 10 '11 at 17:03
  • The TCP connection is disconnected when there is no activity for some time. But if 20000 requests are received by Server A in 1 sec, all of them will be sent through the same connection. – Shawn Mar 10 '11 at 18:15

Ok, correct me if I'm wrong, but this is the situation you have right now:

enter image description here

And this is what you're proposing:

enter image description here

This will only help if the bottleneck is inside B. If the bottleneck is between B and A, then this will only make things worse.

If the bottleneck is inside B, then adding LB will increase overheads in term of switching back and forth, but it will distribute your load fairly evenly over the two servers.

  • Plus one for the hand drawn diagram :) – Jacob Mar 8 '11 at 23:41
  • @Jacob - I was going to use Visio but I was able to draw that in the time it takes Visio to start up and create a blank document. – Mark Henderson Mar 8 '11 at 23:44
  • No this is much better :) – Jacob Mar 9 '11 at 0:16
  • Thanks, Mark! I added a link to a visio diagram. Cannot post image directly since I don't have enough credits. – Shawn Mar 10 '11 at 15:51
  • I believe the bottleneck is inside B. However, seems there's no easy way to distribute the requests from the same direct source (server A) and on the same connection. – Shawn Mar 10 '11 at 15:55

No. Load balancers work by moving connections from one server to another. The connection would need to disconnect then send the next request, that or just make 100 connections and then send one request over each connection. As everything is happening over a single connection you are pretty much hosed without doing some redesign.

  • Thanks. I'm now trying to find out if L7 switching could help. – Shawn Mar 10 '11 at 16:28

Provided that each request is a new TCP connection(and the data being requested is relatively static) this could be load balanced using something like Linux Virtual Server. However if you are able to modify the application why not build the load balancing in there instead?

  • I can only modify Server B. It seems we can implement our own layer-7 load balancing, which involves parsing the XML requests and forward requests to a Server B. Not sure if Linux Virtual Server can help and if the performance will be satisfying though. Don't want to implement from 0. – Shawn Mar 10 '11 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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