advanced 2 min answer

In July 2019 a single regex deployed globally took Cloudflare's network to 100% CPU within seconds. What does this say about how configuration should be released?

deploymentblast-radiusconfigcase-study
Show the full answer Hide the answer

The case, as publicly reported

On 2 July 2019, Cloudflare deployed a new managed WAF rule. It contained a regular expression that caused catastrophic backtracking — exponential CPU consumption on certain inputs. Because WAF rules were pushed globally and near-instantly, CPU across the network saturated within seconds and customers saw widespread 502 errors for roughly half an hour.

Cloudflare's own postmortem is unusually direct about the cause: the rule was deployed globally without a staged rollout, and there was no fast global kill switch for the WAF.

The lesson

Configuration is code, and it usually has a worse release process.

Code goes through review, tests, CI, canary and gradual rollout. Configuration — feature flags, WAF rules, routing rules, rate limits, ML model versions, DNS records, IAM policies, database parameters — frequently goes out globally, immediately, on a single click, with less review.

Yet configuration changes can have identical or larger blast radius, and they are more frequent.

What proper configuration release looks like

Staged rollout with the same discipline as code. Deploy to a test environment, then one point of presence, then one percent, then a region, then globally — with automated abort on health regression at each stage. Cloudflare adopted exactly this afterwards.

A global kill switch that is tested. The ability to disable a subsystem in seconds, exercised regularly so it is known to work, and reachable through a path that does not depend on the subsystem being disabled.

Automated safety analysis for the specific hazard class. Regexes can be checked for catastrophic backtracking statically, or run on a backtracking-free engine (RE2) which cannot exhibit the behaviour at all. The general form: where a class of input can cause unbounded resource consumption, remove the possibility structurally rather than relying on review.

Resource limits per unit of work. A CPU budget per request means a pathological rule degrades that request rather than the process.

The wider point

Ask of any system: what is the fastest a change can reach 100% of production, and what stops a bad one? If the answer to the first is "seconds" and the second is "review", the risk is concentrated exactly where the controls are weakest.

What a strong answer adds

Noting the tension honestly: security rules are pushed fast for a reason — a WAF rule blocking an active exploit is worth deploying in seconds. The answer is not to slow everything down but to separate emergency pushes (fast, with a kill switch and heightened monitoring) from routine ones (staged), and to make that distinction explicit rather than implicit.