Forum Discussion

hooleylist's avatar
hooleylist
Icon for Cirrostratus rankCirrostratus
May 07, 2009

Using server initiated connections for load balancing?

A customer brought up an interesting idea today:

 

 

Allow the application server to establish a connection to LTM which LTM in turn uses to handle subsequent client requests. The LTM-server connections would have long idle timeouts. The idea is that this would eliminate the need for firewall rules allowing connections from LTM to the app servers. This would be particularly suited to a scenario where the app server members change frequently.

 

 

The application server would be responsible for re-establishing a connection with LTM if the connection was closed. If a client request was ready for load balancing and no server side connection was available to handle the request an appropriate error message would be sent from LTM to the client.

 

 

I can't really see a method for implementing this logic. I was thinking that the listen command might provide something close.

 

 

Anyone have thoughts/suggestions on this?

 

 

Thanks,

 

Aaron

1 Reply

  • I agree. This is interesting idea.

     

     

    look like customer want to glue 2 different connections together. if it is UDP, it might be easier. if it is TCP, one way that I can think of is...

     

    - having 2 virtuals: one listening to client request, another one listening to server requests.

     

    - you may have to have list of available server connnections

     

    - when client_accepted looks up available server connection, glue them together and move it out of the available list

     

    - there should be message queue (for in and out) per each client/server pair

     

    - on vip for server: once tcp connection established, TCP::collect and add one timer event that check periodically. if there is any data in from client, use TCP::respond to send them to server. if server send any data, put it to the related "out" message queue (this will be picked up by client connection irule)

     

     

    after 1 -periodic {

     

    check if there is any data?

     

    TCP::respond $::data($uniquekey)

     

    }

     

     

    - on vip for client: once tcp connection established, if client send any data, put it to the related "in" message queue. also use after command to monitor "out" message queue

     

    - "in" and "out" message queue can be implement by global variable or session variable. I would think global variable will be faster, however, you may need to maintain list of available server per TMM (in case it is CMP). server may play with source port in order to inject server connections to specific TMM. or may just disable CMP for this virtual server.

     

     

    sorry if I misunderstood the requirement...

     

     

    Nat