EnvoyIstio

Complex routing rules with regex are expensive per request

info
performanceUpdated Feb 24, 2026(via Exa)
How to detect:

VirtualService rules with many match conditions and regex patterns in headers or URIs are evaluated on every request. Regex matching is computationally expensive compared to exact or prefix matches. Complex rules increase per-request CPU cost, especially under high traffic volumes.

Recommended action:

Replace regex patterns with exact matches or prefix matches wherever possible in VirtualService match conditions. Group similar rules to reduce total number of match evaluations. For example, use exact header matching instead of regex: 'headers.x-custom-header.exact: value1' rather than 'regex: ^(value1|value2|value3)$'.