Early warning (traffic surges)
Early warning is part of Captcha Protection's When the site is under load check. Under load starts checking visitors once a site is already slow or failing. Early warning starts sooner: when a site suddenly gets far more traffic than usual from many addresses, most of them new, or when its response time climbs well above its normal, before it gets slow.
The check is based only on the traffic the sentry sees: the number of requests, the addresses they come from and how long the origin takes to answer. Origin servers don't report their own load.
Turning it on
On Settings › Captcha Protection, tick When the site is under load, then choose Early warning:
| Choice | What happens |
|---|---|
| Off | Only the under-load check applies (the default) |
| Log only (record who would be checked) | During a surge, visitors aren't checked. Logs shows who would have been checked, as Browser check: traffic surge under Would have blocked, last 24 hours on the domain's Blocks tab |
| On (check visitors) | During a surge, every visitor without a pass is asked to complete the browser check, as with Under load |
Early warning needs When the site is under load: without it, the choice is ignored. Start with Log only, so you can see whether a newsletter or a busy sale would set it off before you turn it on.
On the All clusters tab, the choice applies to every cluster. A cluster tab can only choose a stronger setting for that cluster (for example On where all clusters have Log only).
How it decides
Each sentry learns what's normal for each site from its own traffic, minute by minute. It needs 30 calm minutes of traffic for a site before it can spot a surge there, and it keeps learning only from calm minutes, so a surge doesn't become the new normal. What it has learnt is kept across sentry restarts.
A minute counts as a surge when either:
- the site gets at least 600 requests and at least four times its usual number, and they come from at least 100 addresses and four times its usual number of addresses, or at least 70% of the addresses (and at least 100) weren't seen in the last hour; or
- the average response time, over at least 20 requests passed to the origin, is at least 0.8 seconds and three times its usual.
Early warning turns on after 2 surge minutes in a row. It turns off after 5 normal minutes, and never sooner than 10 minutes after it turned on.
Verified crawlers, your never-check addresses, your own sentries, origin servers, cluster VIP and SSH allow-list don't count towards a surge.
While the domain is in log mode
While a domain's Website protection rules are in log mode, early warning only logs, even when it's set to On.
Domain owners
When you let domain owners change Captcha Protection (see Owner access), owners who choose Choose my own checks can also set early warning for their site, with the same three choices, under When the site is under load.
In your logs
Visitors checked during a surge show on Logs as Browser check: traffic surge. The domain's Captcha Protection card lists Early warning (or Early warning (log only)) among its checks.
Early warning needs sentry release 1.1 or later: older sentries ignore it.