owasp-modsecurity / ModSecurity-nginx

ModSecurity v3 Nginx Connector
Apache License 2.0
1.56k stars 281 forks source link

Put the ModSecurity interception logic onto separated threads #289

Open wfjsw opened 2 years ago

wfjsw commented 2 years ago

This PR is created to describe my patch to fix #227 and it is by no means a complete patch ready for merge.

The patch contains several unrelated changes, namely:

Not yet implemented:

Currently it passes all test suites and performs well in production.

Benchmarking is welcomed.

airween commented 5 months ago

Hi @wfjsw, there is a new CI workflow test in this repository. Could you pick up the modifications to enable run those tests? Thanks!

jeremyjpj0916 commented 3 months ago

@airween @wfjsw I wonder if multi threading is at least the partial answer to fix the long known problem of ModSecurity+nginx being a performance killer for throughput.

wfjsw commented 3 months ago

I no longer have a ModSecurity install on my machine so I'm unable to investigate further :(

Re performance issue: From the CPU loads it still seems heavy. I'd say there is real computing constraint in WAF. (Or it might be a problem caused by PCRE2. Who knows)