question: the slowest request a visitor can send nearly uses up waf's time to decide #401

Open
opened 2026-11-16 08:24:20 +01:00 by clawbot · 1 comment
Collaborator

rproxy asks waf about every request and waits up to 2 seconds. Of that, waf has 1 second for its attack filter (the Core Rule Set). Measured while fixing the filter's timing test (#400 (comment)): the slowest request a visitor can send takes the filter 0.64 to 0.96 seconds of processor time at normal load, and about 1.2 seconds when every core is busy.

By your ruling (#385 (comment)), a request waf cannot decide in time is a bug in waf. On a busy server, this request can already miss the time, and each miss counts toward opening the circuit breaker.

Example: a visitor sends repeated requests with the largest body the filter reads, built to be slow to inspect. On a loaded server each takes over a second to decide; five in five seconds open the breaker, and then every visitor gets the no-answer setting.

Options:

  • Read less of each request: lower how much of a body the filter inspects, today 8 KiB, until the slowest request fits with room under full load. Simple; the filter sees less of large bodies.
  • Find and fix the slow rules: profile which Core Rule Set rules cost the time on that request and exclude or replace them. Keeps the 8 KiB, more work, and the rule set changes.
  • Give waf more time: raise rproxy's 2-second wait. One constant; every visitor waits longer when waf is slow.

Recommendation: find and fix the slow rules first, measured on the worst-case request; fall back to reading less only if that does not leave room.

Model: opus-5-5

`rproxy` asks `waf` about every request and waits up to 2 seconds. Of that, `waf` has 1 second for its attack filter (the Core Rule Set). Measured while fixing the filter's timing test (https://git.eeqj.de/sneak/smallwebwaf/issues/400#issuecomment-181821): the slowest request a visitor can send takes the filter 0.64 to 0.96 seconds of processor time at normal load, and about 1.2 seconds when every core is busy. By your ruling (https://git.eeqj.de/sneak/smallwebwaf/issues/385#issuecomment-181334), a request `waf` cannot decide in time is a bug in `waf`. On a busy server, this request can already miss the time, and each miss counts toward opening the circuit breaker. **Example**: a visitor sends repeated requests with the largest body the filter reads, built to be slow to inspect. On a loaded server each takes over a second to decide; five in five seconds open the breaker, and then every visitor gets the no-answer setting. **Options**: - **Read less of each request**: lower how much of a body the filter inspects, today 8 KiB, until the slowest request fits with room under full load. Simple; the filter sees less of large bodies. - **Find and fix the slow rules**: profile which Core Rule Set rules cost the time on that request and exclude or replace them. Keeps the 8 KiB, more work, and the rule set changes. - **Give `waf` more time**: raise `rproxy`'s 2-second wait. One constant; every visitor waits longer when `waf` is slow. **Recommendation**: find and fix the slow rules first, measured on the worst-case request; fall back to reading less only if that does not leave room. Model: opus-5-5
sneak was assigned by clawbot 2026-11-16 08:24:20 +01:00
Author
Collaborator

Assigned to sneak: the choice above changes what waf inspects.

Model: opus-5-5

Assigned to sneak: the choice above changes what `waf` inspects. Model: opus-5-5
clawbot added the needs-decisionneeds-decisionneeds-decision labels 2026-11-16 08:24:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#401