core icon indicating copy to clipboard operation
core copied to clipboard

More than 1200 php processes - 99 % memory and swap usage

Open smart7324 opened this issue 1 year ago • 2 comments

Important notices

Our forum is located at https://forum.opnsense.org , please consider joining discussions there in stead of using GitHub for these matters.

Before you ask a new question, we ask you kindly to acknowledge the following:

  • [X] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [X] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Problem

Today I logged into my OPNsense dashboard and saw 99% memory and swap usage. I found out that there were 1231 php processes running, each using more than 60 MB of RAM.

A reboot of course fixed the issue, as after reboot only 8 php processes are running, but this can happen again I guess?

How can there be so many processes? Isn't there any limit set how many php processes can be spawned? I kind of know the configuration of php-fpm, there you can provide a maximum number of processes to fork. But it seems OPNsense core is not using php-fpm, but php-cgi.

I would be very happy about any help!

OPNsense 24.1.6-amd64 FreeBSD 13.2-RELEASE-p11 OpenSSL 3.0.13

Never experienced these problems before...

smart7324 avatar May 01 '24 08:05 smart7324

ps faxd | grep php ?

AdSchellevis avatar May 01 '24 09:05 AdSchellevis

Yeah now it's only the 8 processes. Will keep an eye on it and reply if it rises again...

root@opnsense:~ # ps faxd | grep php
 2996  0  S+     0:00.00 |       `-- grep php
19370  -  Is     0:00.03 | |-- /usr/local/bin/php-cgi
20452  -  S      0:01.49 | | |-- /usr/local/bin/php-cgi
22164  -  I      0:00.15 | | |-- /usr/local/bin/php-cgi
23878  -  I      0:00.76 | | `-- /usr/local/bin/php-cgi
20027  -  Is     0:00.03 | `-- /usr/local/bin/php-cgi
16663  -  S      0:00.75 |   |-- /usr/local/bin/php-cgi
46318  -  S      0:00.42 |   |-- /usr/local/bin/php-cgi
73876  -  S      0:00.45 |   `-- /usr/local/bin/php-cgi

smart7324 avatar May 01 '24 10:05 smart7324

So as it never happened again, I think we can close this issue now.

smart7324 avatar Jul 26 '24 13:07 smart7324