tokers commented on issue #7505: URL: https://github.com/apache/apisix/issues/7505#issuecomment-1190947667
> That's it! It's really CPU-bound. I'm building a WAF plugin, based on Lua code and a Rust dylib. > > It has hundreds of rules, most of them are regular expressions. I verified with the flame graph, most of the CPU is consumed on regular matching(DFA). The time for regular matching increases linearly with the size of the request body. > > So the question is I want my plugin to have a response time guarantee, not affected by the size of the request body. Another way of thinking is avoiding the execution of WAF blocks other requests' running. So why not add some `ngx.sleep(0)` hooks in your codes so that other requests can also get the chance to run during the WAF execution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
