Closed fionera closed 1 month ago
Ok this is a side effect of coraza allocating the response body on every request. Maybe this should be replaced with a buffer pool
Hey! So there is no issue?
I really don't know. I have to investigate more because I get different results via go Benchmarks and running the process with pprof export built in
Maybe this should be replaced with a buffer pool
We use a pool of transactions and each of them has a buffer for request/response body.
Yeah so was my idea. There is a static maximum size anyway, so there is nothing against it. I do the same inside my haproxy package.
I would think that replacing TransactionVariables.responseBody
with static capacity byte slice that gets reused between transactions would help a lot
Description
Somewhere since version v3.0.1, a bug was introduced increasing memory usage a lot.
Steps to reproduce
Run a couple thousand requests again a coraza instance. I can provide pprofs which show this behaviour
Expected result
What should happen? Static or at least not that high of an increase of memory
Actual result
Lots of memory.