Forum Discussion

taro_112311's avatar
taro_112311
Icon for Nimbostratus rankNimbostratus
Nov 07, 2007

Can http monitor use Keep-Alive?

Is the connection reused when specified "Connection:Keep-Alive"?

 

 

Should I specify "Connection:Close"?

 

 

5 Replies

  • Yes, and yes. To close the connection, you can use a send string like this:

     

     

    GET /path/to/file.html\r\nHost: example.com\r\nConnection: close\r\n

     

     

    Aaron
  • Is it correct in the following understanding?

     

     

    Specifying "Connection:Keep-Alive" is efficient, because the connection established first keeps being used.

     

     

  • Sorry, I mis-read your original question. I know that the connection to the server can be kept open if the Connection: close isn't used, and that this can leave connections open for longer than necessary, but I don't know whether LTM would ever re-use it if it's still open. I'll try testing to see.

     

     

    Aaron
  • Testing on 9.2.x, I see LTM selecting a new port regardless of the send string configuration, which I guess follows with the recommendation to use the Connection: close header to tell the server to close the TCP connection.

     

     

    Aaron
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Thanks for clarifying, Aaron.

     

     

    It was my understanding as well that LTM would not re-use a monitor connection even if it was specified as a Keep-Alive connection.

     

     

    Best practice is to specify either HTTP 1.0 or Connection: Keep-Alive to keep the connection to the server from remaining open longer than necessary.

     

     

    /deb