Forum Discussion

EricRs_201906's avatar
EricRs_201906
Icon for Nimbostratus rankNimbostratus
May 22, 2015
Solved

iRule: Adjust idle timeout for 1 particular call

Hello,

 

I had a few questions if anyone has implemented or tried this I know there's a wiki link for it, link, However I wanted to know if the sample request would open the idle time out for ALL requests to the box during that window we set or if it will only set for that one request and all subsequent calls after will be set to the default of 300 seconds.

 

Also would it help if we added an elseif? if so would that then terminate the request that's already in process of the call?

 

sample code(s) is as such

 

when HTTP_REQUEST {
 if {[HTTP::uri] starts_with "/portal" } {
  IP::idle_timeout 7200
  }
}
when HTTP_REQUEST {
 if {[HTTP::uri] starts_with "/portal" } {
      IP::idle_timeout 7200
   }
 else {
      IP::idle_timeout 300
}  
  • The use of "else" clause is good for visibility reasons. Admin does not have to check the settings inside a TCP profile to know what the TO value is for all other requests.

    For efficiency, I recommend using a comparison against

    [string tolower[HTTP::path]] starts_with
    , instead of your current
    [HTTP::uri] starts_with
    statement.

6 Replies

  • The use of "else" clause is good for visibility reasons. Admin does not have to check the settings inside a TCP profile to know what the TO value is for all other requests.

    For efficiency, I recommend using a comparison against

    [string tolower[HTTP::path]] starts_with
    , instead of your current
    [HTTP::uri] starts_with
    statement.

    • Hannes_Rapp's avatar
      Hannes_Rapp
      Icon for Nimbostratus rankNimbostratus
      Also note that your iRule only has the expected effect, if by requesting page "/portal*" there are no requests made to other pages served via the same VIP (e.g JPG, CSS, PNG etc.. files in "/static_files"). Since HTTP1.1 a single TCP connection is used for multiple GET requests. Therefore, if any content on page is in another parent directory, the IDLE timeout value will be repeatedly overwritten and this affects performance negatively. What's more, the actual timeout value on /portal page can still be 300 seconds (assuming the last request was made to /static_files/mylogo.png).
    • EricRs_201906's avatar
      EricRs_201906
      Icon for Nimbostratus rankNimbostratus
      Yes Portal is just a place holder.. I believe an ASMX page is what will be called however I'm waiting for the developer on the ASMX to tell me what the actual call is :)
  • The use of "else" clause is good for visibility reasons. Admin does not have to check the settings inside a TCP profile to know what the TO value is for all other requests.

    For efficiency, I recommend using a comparison against

    [string tolower[HTTP::path]] starts_with
    , instead of your current
    [HTTP::uri] starts_with
    statement.

    • Hannes_Rapp_162's avatar
      Hannes_Rapp_162
      Icon for Nacreous rankNacreous
      Also note that your iRule only has the expected effect, if by requesting page "/portal*" there are no requests made to other pages served via the same VIP (e.g JPG, CSS, PNG etc.. files in "/static_files"). Since HTTP1.1 a single TCP connection is used for multiple GET requests. Therefore, if any content on page is in another parent directory, the IDLE timeout value will be repeatedly overwritten and this affects performance negatively. What's more, the actual timeout value on /portal page can still be 300 seconds (assuming the last request was made to /static_files/mylogo.png).
    • EricRs_201906's avatar
      EricRs_201906
      Icon for Nimbostratus rankNimbostratus
      Yes Portal is just a place holder.. I believe an ASMX page is what will be called however I'm waiting for the developer on the ASMX to tell me what the actual call is :)