-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance drop with larger request body #1176
Comments
200bytes only? That sound awful. Do you have benchmarks that can be shared? CC: @jptosso |
Also, what is the connector? |
@fzipi @jptosso actually this data is achieved by running coraza-benchmark with latest CRS ruleset:
A test is structured as:
Whether |
Thanks for letting us know. We'll try to see what happens there. |
That package is completely deprecated. I will try to bring the latest version back to life. Results are nowhere similar to that. In my experience, in production, coraza often runs at least 1.2 to 2 times faster. |
Are you referring to coraza-benchmark?
Have you been testing varying request body payload ( Also, I'd like to know why is modsec comparison not representative in your opinion. |
Yup, coraza-benchmarks We should document this process and archive that repo |
@jptosso @fzipi at present still using coraza-benchmark to pinpoint why increased request body causes significant performance drop. Running only tests with request body payload as in my previous message and increasing it, coraza-benchmark is instrumented with pprof:
If I look at the profiling data's SVG file, it appears that the path leading up to heavy regex processing is from Looking forward for your input. |
As mentioned before, we will archive coraza-benchmark and provide a new benchmarking mechanism. |
@jptosso thank you, indeed coraza-wasilibs solves this issue although at the cost of significantly increased memory usage. In our test it went up from max RSS usage of around 68 MB (bare Coraza) to 257 MB (Coraza with wasilibs), see below. Is there a way to improve regexp performance without wasilibs, that is keep memory usage low, or perhaps improve wasilibs for lower memory profile? Benchmarks: Bare Coraza
With wasilibs
|
Good to hear |
Maybe use https://github.com/VectorCamp/vectorscan instead. |
When you say you tested hyperscan - does it mean there is a prototype implementation of coraza with hyperscan? |
We will post results about our research after the Owasp project summit this month |
Using hyperscan would vendor-lock us to Intel, so it got discarded. In the meantime, we will have to stick to go-re2 |
Any reasons not to make it switchable opt-in? The reason I'm asking this is that in our case it will not be a problem to simply ship multiple binaries |
hyperscan works with Intel & AMD CPUs Does that change the decision in any way? |
oh, and just in case, we have seen 3x performance improvement with hyperscan/vectorscan on regex matching against files (vs re2). So, it is a rather drastic change in both throughput & CPU usage |
That looks interesting. I will run some tests |
We are evaluating Coraza WAF and have observed significant performance degradation when processing larger request bodies. Specifically, starting from a request body size of around 200 bytes, Coraza’s throughput decreases by 2 to 3 times compared to ModSecurity using the same OWASP Core Rule Set (CRS) v4.
Is this a known issue with Coraza’s handling of larger request bodies?
The text was updated successfully, but these errors were encountered: