Forum Discussion

Matt_Breedlove_'s avatar
Matt_Breedlove_
Icon for Nimbostratus rankNimbostratus
Apr 21, 2011

Concurrency with multiple VS using a single global var

 

 

In the scenario of having three different VS's simultaneously taking traffic on their respective ports....a port 443 VS, port 8080 VS, and port 8181 VS. All VS's have the same IP. Each VS has an irule that increments the same numeric global var declared in rule_init. As those VS's take traffic from different clients, will that possible cause a concurrency/race issue?

 

 

 

Thanks

 

M

 

 

4 Replies

  • Hi Matt,

     

     

    Which LTM version are you doing this on? In any version, I think access to the global variable will be serialized. Maybe others can confirm/correct this.

     

     

    However, using a global variable will prevent a virtual server from being processed via CMP on multiple TMM instances. If you're on a version and platform which support CMP, it would be better to use the session table or subtable to store the variable. Here's an example for using the session table. See the links for details on CMP.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/CMP_v10_compatible_counters_using_the_session_table.html

     

     

    Aaron
  • Hi Aaron,

     

    All of the VS's always on a single LTM/TMM instance that is either 9.4.8 or 10.1 (depending on the datacenter)

     

    The multiple VS's are just to allow multiple externalized ports access to the same internal pool of servers. It would be fantastic if you can confirm that incrementing access to the global var is serialized for multiple VS's incrementing the same global counter

     

    On the CMP...All of our LTM HA implementations involved active/passive pairs of LTMs...either 6400's or Viprions. So only one is ever active, and the other is a warm standby. It sounds like this is for some level of shared processing by both nodes in the LTM pair, but since we aren't doing that its probably moot. We have used global vars for sometime, just wanted to check that if multiple VS's are incrementing the same global var on the same TMM instance, that it wont produce a race condition or another anomaly.

     

    Curious...assuming all in bound connections/requests are serialized into single consecutive set of requests for multiple VS's using one IP, but different ports, how does LTM handle breaking the "tie" if two connections/requests arrive at literally the same time on two of the VS's?

     

    Thanks

     

    M

     

     

     

     

     

     

     

  • TMM is the traffic management microkernel. CMP allows BIG-IP to run multiple TMM instances per platform (one per CPU core). The 6400 and Viprion platforms both support CMP. Using a global variable in an iRule will prevent the virtual server from being processed on multiple TMM instances. Access to the session table is CMP compatible as of v10.0. Access to global variables and the session table should both be serialized. I don't think two access attempts can be processed at the exact same instant--they would be serialized.

     

     

    Aaron
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Check your other post for some additional info:

     

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1178716/showtab/groupforums/Default.aspx

     

     

    I figured I'd avoid the re-post. ;)

     

     

    Colin