Forum Discussion
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?
is correct, and the article link shows evidence and a test policy and iRule if you want to try it for yourself, but for clarity here, beginning with the introductions of policies in 11.4 the policy will always fire first and that cannot be modified.
5 Replies
- Huaxing_Wang
Employee
- JRahm
Admin
is correct, and the article link shows evidence and a test policy and iRule if you want to try it for yourself, but for clarity here, beginning with the introductions of policies in 11.4 the policy will always fire first and that cannot be modified.
- Algebraic_Mirror
Cirrostratus
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
Admin
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
- Algebraic_Mirror
Cirrostratus
Perfect! Thank you !
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com