Skip to content

NginX binary with modsecurity consume all memory and crashes #1563

Closed
@intelbg

Description

@intelbg

Hello again and sorry for the inconvenience,
I am using libmodsecurity V3 (nginx_refactoring branch) + nginx connector with CRSv3 and when I put this binary of nginx in production with around 150 -200 vhosts, after I make even service nginx configtest (or restart) the server is on 150-200 load immediately (strace show that there are a lot of wait4 sys calls) and the process takes around 20-30 seconds. I tried to remove the CRS rules folder to see if the problem is in the number of lines/files or in the binary but no big difference. With binary without modsec everything is ok. Also, with the modsec nginx binary there is a memory allocation problems on restart and nginx does not want to start. Removed all limits on the operating systems including cgroups, ulimit, sysctl etc but no effect. If I back the binary without modsec everything is fine.

Is here anyone that faced such a problems and is there a chance to:

  1. The binary to be not compiled with the right options, by the right way or something other?
  2. The nginx to trigger all the modsec functions on restart even when mod security on is not present on the vhosts?
  3. I tried to optimize everything that I found but it's the same.

The machines are with 32GB of ram, 12 or 16 cpu cores and normal HDDs. On SSD it's a little bit better.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions