Skip to content
Notifications
Clear all

Step-by-step: Reducing latency by optimizing the routing rules.

2 Posts
2 Users
0 Reactions
3 Views
(@cloud_infra_vet)
Reputable Member
Joined: 2 months ago
Posts: 134
Topic starter   [#1145]

Having recently completed a performance audit for a client migrating their e-commerce platform to AWS, I observed a recurring and often underestimated source of latency: suboptimal routing rule configuration within their application delivery controller, in this case, Radware's Alteon VA. While the platform was functionally correct, the order and logic of content switching rules were creating unnecessary processing overhead and adding milliseconds to each request. In a high-volume environment, this compounds rapidly. I'll detail the specific inefficiencies we found and the iterative process we used to refactor the ruleset, resulting in a measurable decrease in average response time.

The initial configuration suffered from a common issue: a sequential list of rules checking various HTTP headers and URI paths, with the most frequently accessed paths buried near the bottom. Each incoming request had to be evaluated against multiple, sometimes redundant, conditions before hitting a match. The configuration snippet looked something like this:

```text
slb policy csr "policy_1"
condition 1 url eq "/api/v1/admin/*"
action 1 server group "admin_sg"
condition 2 header "X-Device-Type" eq "mobile"
action 2 server group "mobile_sg"
condition 3 url beg "/static/"
action 3 server group "static_sg"
condition 4 url eq "/"
action 4 server group "primary_sg"
default server group "catchall_sg"
```

The optimization process followed these steps:

1. **Analysis & Telemetry:** We enabled detailed logging on the Alteon and correlated it with application metrics from our APM tool. This revealed that over 70% of traffic was hitting the root ("/") or "/static/" paths, yet they were evaluated after less frequent rules.

2. **Rule Re-ordering:** The most critical step. We re-ordered rules based on probability of match, placing the highest-traffic paths first to minimize the number of comparisons for the majority of requests.

3. **Condition Simplification:** We consolidated multiple rules checking similar patterns (e.g., several API paths going to the same server group) into single, broader conditions using more efficient operators like `beg` (begins with) instead of multiple `eq` (equals) statements where possible.

4. **Default Rule Hardening:** The default catch-all group was reviewed to ensure it pointed to a designated "maintenance" or "error" pool, not just the primary application pool, for security.

The refactored configuration prioritized traffic flow:

```text
slb policy csr "policy_1_optimized"
condition 1 url beg "/static/"
action 1 server group "static_sg"
condition 2 url eq "/"
action 2 server group "primary_sg"
condition 3 url beg "/api/v1/admin/"
action 3 server group "admin_sg"
condition 4 header "X-Device-Type" eq "mobile"
action 4 server group "mobile_sg"
default server group "maintenance_sg"
```

The outcome was a reduction in the 95th percentile response time by approximately 11%. This wasn't due to any increase in backend capacity, but purely from reducing the decision latency within the Radware Alteon itself. Key takeaways for anyone looking to perform similar optimization:

* **Measurement is non-negotiable.** Never reorder rules based on assumption; always use traffic data.
* **The principle of fastest match applies.** This is fundamental to network device performance.
* **Review rule sets after major application updates.** New features often lead to new rules appended to the end of the list, recreating the problem over time.
* **Consider moving highly dynamic, attribute-based routing (e.g., mobile vs. desktop) to the application layer** if the rule set becomes too complex, as it can be more efficient to handle there.

I'm interested to hear if others have employed similar or alternative techniques for latency reduction at the ADC layer, particularly around leveraging more advanced features like caching directives or SSL profile tuning in conjunction with rule optimization.



   
Quote
(@Anonymous 211)
Joined: 1 week ago
Posts: 19
 

Ah, the classic "most-frequent-path-at-the-bottom" anti-pattern. I see this all the time in proxy configs, not just Alteon. It's weird how these rulesets organically grow in the wrong direction.

I've been using Claude with a custom prompt to audit Nginx location blocks for the same thing. You feed it the config and access logs, and it suggests a reorder based on hit rate. It's surprisingly good at spotting redundant regex checks that should be simple prefix matches.

Was there a specific metric you used to decide the final rule order, or was it purely based on empirical testing after the refactor? I'm always torn between log analysis and just simulating a few thousand requests.



   
ReplyQuote