-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SecRuleEngine off - still performance numbers drop #644
Comments
Depends on: #645 |
Had incorporated your fix - still the performance doesn't seem to increase. |
I measure performance by setting RuleEngine to either of 3 options Off ,Detection,On . *************** ngx_http_modsecurity_handler(ngx_http_re
|
Performance tool used tool is Apache Bench Configuation TPS measured in iteration 1 2 3 4 5 nginx+modsec - off 1379.49 1397.04 1501.31 1113.12 1304.99 |
Hi @mitha, Nice that you are interested on ModSec' performance, specially on Nginx which is using our standalone module. We will love to have something incorporate to the project to measure those results in a systematic fashion, using scripts or so. That way we will be able to make comparisons between different versions in a easy way. If you are interested in provide such scripts or ideas, lets open an issue to discuss that. I understand that in the scenario that you have described the results seems a little unhoped. But, there is an explanation regarding the fact that "SecRuleEngine Off" is messing with the performance. We have two different methods to "disable" Nginx' ModSecurity module, the first is using the ModSecurityEnabled and the second is by using the SecRuleEngine. I expect that while setting ModSecurityEnabled to Off the results will be very similar to the results without ModSecurity. However, using the SecRuleEngine, the results will be like you've showed. Let me explain the difference, ModSecurityEnabled is saved under the structure:
This ngx_flag_t enable is used by many others Nginx modules, such as:
Like those modules, whenever enabled is set to Off, it is expected that ModSecurity does not significant impact on the performance. The SecRuleEngine is a little different, it is rule in first place which demands ModSecurity to actually process it. Whenever SecRuleEngine is set to Off, it means that rules processing should not be working, it does not complete disable ModSecurity. Remember that SecRuleEngine can have a third value different from On and Off. DetectionOnly places the rules in verbose mode but not execute any disruptive action. While using SecRuleEngine to DetectionOnly it is also expected a performance harm. Looking for the labels that you have placed in your measurements results, i am wondering if the correct comparison will be something like (at least looking at the code like it is today):
This open space for other discussion, which is related to your patch: what the practical different between SecRuleEngine off and ModSecurityEnabled Off, Can/Should we have only one place to set it to On/Off or DetectionOnly like we have in Apache? What is your opinion? Looking at your patch it almost placed the SecRuleEngine in equal foot to ModSecurityEnabled. If it is the case, we can remove one of those. What do you think? Thanks, |
Hi Zimmerle Good to get an almost immediate reply Now on to the discussion topic - To measure performance: This is how i used it ab -n 500000 -c 100 -k "http://ec2-54-235-2-8.compute-1.amazonaws.com/test_dir/1kb.txt" TPS is the important factor that we take into account as a result of performance measurement and that is the deciding factor for choosing various configuration You are right about the comparison and i also did the same And regarding having SecRuleEngine and also ModSecurityEnabled , i am not sure what other significant purpose SecRuleEngine have other than having either of the 3 options. Thanks and Regards |
Hi Zimmerle Good to get an almost immediate reply Now on to the discussion topic - To measure performance: This is how i used it ab -n 500000 -c 100 -k " TPS is the important factor that we take into account as a result of You are right about the comparison and i also did the same And regarding having SecRuleEngine and also ModSecurityEnabled , i am not Thanks and Regards On Fri, Jan 24, 2014 at 8:19 AM, Felipe Zimmerle
|
The same problem.running a few times, modsecurity high memory usage 97.6% 1500~~2000 users |
Marking as won't fix in 2.x. That is already Ok in libmodsecurity. https://github.com/SpiderLabs/ModSecurity/tree/v3/master |
Hi
modsecurity version - 2.7.5
nginx versoin - 1.4.2
owasp rules set - 2.2.8
I am using modsecurity as WAF inline with nginx serving as reverse proxy.
I am trying to measure the performance of nginx with mod security with SecRuleEngine - off,detection,on and without modsecurity.
What i find is as soon as modsecurity is introduced in nginx.conf ,though SecRuleEngine is set to off,the performance - transaction per second - TPS drops.There is no significant difference between SecRuleEngine being set to on/off/detection in TPS measurement.
I could see in the modsecurity debug log that the transactions are not processed
My question is :
What i dont understand is,even though the transactions are not processed in modsecurity when SecRuleEngine is off why the performance should drop when it is introduced in nginx?
configuration TPS
nginx only 3594
nginx+modsec+SecRuleEngine-off 1399
nginx+modsec+SecRuleEngine-detection 342
nginx+modsec+SecRuleEngine-on 580
Load generator/Stress tool used - weighttp(WG)
Configuration:
The following configuration is kept on for all the below given tests
total request - 500000
connection rate - 100/s
keep alive - on
file size fetched - 1kb
cpu - 1
All the fetches are genuine ,No threats were injected
VM size - small
nginx running process - 1 each master,worker,cache manager process
The text was updated successfully, but these errors were encountered: