Forum Discussion

Algebraic_Mirror's avatar
Algebraic_Mirror
Icon for Cirrostratus rankCirrostratus
Nov 12, 2019
Solved

LTM Traffic Policies vs iRules: Which runs first?

If you create an LTM traffic policy that has a rule operating at request time, and you create an iRule with a "when HTTP_REQUEST" event declaration, and you assign them both to the same virtual server, which of the two will run first?

5 Replies

  • Thank you both! This is exactly what I was looking for.

     

     If I can ask one more clarification though, it would be this: this precedence only happens when the local traffic policy and the iRule are trying to use the same event, right? For example, if an iRule tried to process the "when CLIENT_ACCEPTED" event, that would happen before a traffic policy rule that fires for an HTTP Request, right?

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      Yes, in context of when the traffic is being processed by TMM, the policy fires first and then the iRule. Here's the log entries from the article given similar policy and iRule on same virtual server:

       [/Common/http_event_order/policy_rule_logging]: Client Accepted Timestamp: 1532565045277
      Rule /Common/http_event_order <CLIENT_ACCEPTED>: Timestamp: 1532565045278
      [/Common/http_event_order/policy_rule_logging]: Request Timestamp: 1532565045279
      Rule /Common/http_event_order <HTTP_REQUEST>: Timestamp: 1532565045279
      Rule /Common/http_event_order <HTTP_REQUEST_RELEASE>: Timestamp: 1532565045282
       [/Common/http_event_order/policy_rule_logging]: Response Timestamp: 1532565045285
      Rule /Common/http_event_order <HTTP_RESPONSE>: Timestamp: 1532565045285
      Rule /Common/http_event_order <HTTP_RESPONSE_RELEASE>: Timestamp: 1532565045285