0

I need a TCP load-balancer in front of some servers. I need it to:

  1. Receive a request from client
  2. Open a connection to one of servers (based on load balancing, being alive and so on)
  3. Send the request as an event to the server
  4. Close the connection to the server
  5. Receive an answer from a server
  6. Answer the client's request
  7. Close the connection from client

So I need to be connected to client and receive request and send answer in one connection, but on the other hand send the request to a server and receive the answer from (maybe another) server in two connections.

Can HAProxy fulfil this requirement? If yes, do you know a good guide for that? If no, is there any other load-balancer for this need?

5
  • Are you asking for a load balancer that persists the connected clients outside of the connection?
    – dtryon
    Feb 6, 2013 at 9:47
  • I do not know the meaning of persisting a client, but I exactly need the load-balancer to connect to the back-end servers asynchronously. I need it to send the request,close the connection, give an answer, recognize which client to send the answer to, and send the answer to client. In all of this time, the client connection will be opened.
    – saeed
    Feb 6, 2013 at 11:41
  • In this scenario, how does the server understand who to send the response to? Is it tracked by some sort of message correlation id?
    – dtryon
    Feb 6, 2013 at 12:50
  • Yes, all responses has an ID which shows their requests. and a LookUpTable or something will memorize the relation.
    – saeed
    Feb 6, 2013 at 13:20
  • Nothing that I have read about HAProxy would suggest that this is possible. It sounds like you need some time of integration pattern (like messaging), not a load balancer.
    – dtryon
    Feb 6, 2013 at 14:12

2 Answers 2

3

Nothing that I have read about HAProxy would suggest that this is possible. It sounds like you need some kind of integration pattern (like messaging), not a load balancer.

A few good messaging tools to look into are RabbitMQ, ZeroMQ and Redis (which can do pub/sub).

2
1

Look at mongrel2. It's based on 0MQ and abstracts the connection from TCP. (I.e. the response can come from anywhere.) http://mongrel2.org/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .