Forum Discussion

sateesh_111062's avatar
sateesh_111062
Icon for Nimbostratus rankNimbostratus
Jan 08, 2010

Question on connection limit

I need a irule on connection limit..Here is the sitution.

 

 

I have set the connection limt to 100 on NODE(properties-config-limt-100) in F5.

 

 

My requirement:

 

 

1) Once node connection limmit reaches to 100. it should serve maintanence page(like site is not available etc)

 

 

OR

 

 

1) Once node connection limmit reaches to 100. it should redirect to other URL(www.maintanencepage.com) where the maintanence page hosted

 

 

seeking for your help

 

 

Regards

 

Sateesh kumar.k

3 Replies

  • Hi Sateesh,

    I don't think there is a good way to do this at the node level. However, what it is possible to set the limit at the member level within the pool. If you do that then you can use the following iRule

     
     when HTTP_REQUEST { 
       if { [active_members http_pool] = 0 } { 
         HTTP::redirect "http://www.maintenancepage.com" 
       } 
     } 
     

    or

     
     when LB_FAILED { 
           HTTP::redirect "http://www.maintenancepage.com" 
        } 
     

    I hope this helps

    Bhattman
  • Hi,

     

     

    I appreciate your quick reply..

     

     

    I have couple of queries on the same..

     

     

    when HTTP_REQUEST {

     

    if { [active_members http_pool] = 0 } {

     

    HTTP::redirect "http://www.maintenancepage.com"

     

    }

     

    }

     

     

    As per your suggestion, i am going to set the limit at the member level within the pool.what is this mean active_members http_pool] = 0 ?

     

     

    I hope above script will match to my requirement...anyhow i am going to explain again:

     

     

    Under the pool -- I have 3 severs and I am going to set the limit to 100 for each server..

     

     

    Ex:

     

     

    server1 reached to 100 then it should redirect maintanence page and same for server2,server3

     

     

    One more thing rather then redirecting to another URL can I do anything with the script and serve maintanence page from F5 only?

     

     

    Regards

     

    Kumar
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Just remember that you're doing this by CONNECTION and not by SESSION...

     

     

    Since a single page can use several connections, what you'll find is not a graceful page give back to users, but people with pages where some of the content is OK, and some has a redirect in it (Which will break when you get back an HTML page instead of a GIF for example).