[GH-ISSUE #82] 开启 ModSecurity后性能影响的问题有什么好方案解决吗? 除了这里的静态配置https://docs.addesp.com/ngx_waf/zh-cn/practice/enable-modsecurity.html #195

Closed
opened 2026-03-13 16:58:18 +03:00 by kerem · 6 comments
Owner

Originally created by @smallhorsegg on GitHub (Jan 7, 2022).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/82

Originally created by @smallhorsegg on GitHub (Jan 7, 2022). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/82
kerem 2026-03-13 16:58:18 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ADD-SP commented on GitHub (Jan 7, 2022):

没有,因为 ModSecurity 的规则十分复杂,又涉及到硬盘和网络 I/O,缓存也不适用。

<!-- gh-comment-id:1007206020 --> @ADD-SP commented on GitHub (Jan 7, 2022): 没有,因为 ModSecurity 的规则十分复杂,又涉及到硬盘和网络 I/O,缓存也不适用。
Author
Owner

@ADD-SP commented on GitHub (Jan 7, 2022):

可能最好的办法就是优化 ModSecurity 引擎本身。

<!-- gh-comment-id:1007206173 --> @ADD-SP commented on GitHub (Jan 7, 2022): 可能最好的办法就是优化 ModSecurity 引擎本身。
Author
Owner

@ADD-SP commented on GitHub (Jan 7, 2022):

详情可以看看 https://github.com/ADD-SP/ngx_waf/issues/73#issuecomment-990742022

<!-- gh-comment-id:1007206740 --> @ADD-SP commented on GitHub (Jan 7, 2022): 详情可以看看 https://github.com/ADD-SP/ngx_waf/issues/73#issuecomment-990742022 。
Author
Owner

@smallhorsegg commented on GitHub (Jan 7, 2022):

没有,因为 ModSecurity 的规则十分复杂,又涉及到硬盘和网络 I/O,缓存也不适用。

开启后发现cpu使用率飙升,而且磁盘io也非常高

<!-- gh-comment-id:1007208255 --> @smallhorsegg commented on GitHub (Jan 7, 2022): > 没有,因为 ModSecurity 的规则十分复杂,又涉及到硬盘和网络 I/O,缓存也不适用。 开启后发现cpu使用率飙升,而且磁盘io也非常高
Author
Owner

@ADD-SP commented on GitHub (Jan 7, 2022):

硬盘 I/O 很高可以通过关闭审计日志解决。CPU 高很头疼,之前已经尝试过许多优化方法了,没有发现适用的。

<!-- gh-comment-id:1007209171 --> @ADD-SP commented on GitHub (Jan 7, 2022): 硬盘 I/O 很高可以通过关闭审计日志解决。CPU 高很头疼,之前已经尝试过许多优化方法了,没有发现适用的。
Author
Owner

@smallhorsegg commented on GitHub (Jan 7, 2022):

okok thx

<!-- gh-comment-id:1007209716 --> @smallhorsegg commented on GitHub (Jan 7, 2022): > okok thx
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#195
No description provided.