MINOR: mux-h2: count excess of CONTINUATION frames as a glitch
authorWilly Tarreau <w@1wt.eu>
Fri, 19 Jan 2024 17:20:21 +0000 (18:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Feb 2024 14:51:49 +0000 (15:51 +0100)
commit28dfd006ca7289889f6238c1befca2f0d622a879
treef47072ff68b1a2fa21e75258dc33e377b3d41ffa
parenteeacca75d16b30dc2dc9b3338c76b04ab24e54bb
MINOR: mux-h2: count excess of CONTINUATION frames as a glitch

Here we consider that if a HEADERS frame is made of more than 4 fragments
whose average size is lower than 1kB, that's very likely an abuse so we
count a glitch per 16 fragments, which means 1 glitch per 1kB frame in a
16kB buffer. This means that an abuser sending 1600 1-byte frames would
increase the counter by 100, and that sending 100 headers per request in
individual frames each results in a count of ~7 to be added per request.

A test consisting in sending 100M requests made of 101 frames each over
a connection resulted in ~695M glitches to be counted for this connection.

Note that no special care is taken to avoid wrapping since it already takes
a very long time to reach 100M and there's no particular impact of wrapping
here (roughly 1M/s).
src/mux_h2.c