Forum Discussion

mvo_65102's avatar
mvo_65102
Icon for Nimbostratus rankNimbostratus
Jun 20, 2014

get actual connection count by an irule

Dear all!

 

I wonder how to read the actual connection count by an irule. (Like snmp does with OIDs or "tmsh show sys connection"..)

 

In this particular case, i want to limit the sessions with an irule. If the total connection limit is reached the irule should redirect to another pool or URL. I dont want to count the connections in a session table or other variable.

 

Maybe you have an idea how this can be done...

 

2 Replies

  • Hi, I dont think there is any other way to do this than a global TMM variable.

     

    What do you mean by a session? You mean a TCP connection?

     

    Assuming you mean TCP connection by "session", then in your irule you would init the RULE_INIT event. IN that rule you would init a global variable such as $TOTAL_CONN_CNT. Then you would create the CLIENT_ACCEPTED event and increment/decrement the TOTAL_CONN_CNT based on the creation and destruction of the TCP connections handled by the irule.

     

    You can do it this way, or you can not do it at all

     

    • mvo_65102's avatar
      mvo_65102
      Icon for Nimbostratus rankNimbostratus
      Hi Matt, thanks for you fast reply. I want to count HTTPS sessions. The problem with the counter within an irule is that it is not exact. Now i am testing this with a table where i count all entries. Looks more stable but still not perfect.