How many HTTP request can access IRules?

Hello Community,

How many HTTP request can access IRules? If more than 1 HTTP request

can access a set of IRules associated with a VS, then do they have their own set of variables or do they share a static variable? “… own set of variables…” meaning each HTTP request variable X can be any value at any point in time. “… share a static variable…” meaning each HTTP request will share 1 variable X value and if it changes then it changes for ALL.

ex) If 2 HTTP request access IRules at the same time and manipulates X variable.

1) HTTP Request 1 changes variable X to “1” in HTTP REQUEST EVENT.

2) Then HTTP Request 2 changes variable X to “2” in HTTP REQUEST EVENT.

3) HTTP Request 2 uses variable X in the HTTP RESPONSE EVENT.

Is HTTP Request 2 variable X equal to “1” or “2”?

Thanks in advance.

TRX

Hi TRX,

Local variables are accessible for the life of the client connection. So X would be equal to 2. See these posts and its links for more info:

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

Aaron

The link you listed is not working properly.

So when you say X is equal to “2”, I’m assuming you’re implying more than 1 HTTP Request can access IRules, correct?

I had an extra letter on the end of the URL. Can you try this:

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

If you have an iRule enabled with code in an HTTP_REQUEST event, the HTTP_REQUEST event will be triggered on each HTTP request. Local variables created or updated at any point during a client’s connection to the virtual server will still be available until the connection is closed.

Aaron

Thanks. I will check it out.

With your example above, does the 2nd HTTP request wait for the 1st HTTP request (HTTP_RESPONSE event) to go out back to the client before the

it enters the HTTP_REQUEST event?

TRX

Clients can pipeline requests with HTTP so that request one and request two are sent before a reply comes back for the first request. I’m not sure how TMM handles that. By default, pipelining is enabled on the HTTP profile. But I think OneConnect does not support pipelining.

I’ll try testing and let you know what I find.

Aaron

Trx: for ‘normal’ variables set in iRules (as opposed to static::, globals, tables or data groups), they are scoped locally per connection. A connection hits the VIP, then instantiates the iRule and the variables are uniquely scoped to that flow. So connection 1 will only ever see connection 1’s variables; ditto connection 2…

In that way an iRule is almost like an “object” that is born when the rule is executed. Without being explicitly global, variables are local.

--Matt Cauthorn