C
C
celovec2020-09-13 11:00:36
PHP
celovec, 2020-09-13 11:00:36

Why is there a constant increase in RAM consumption in php-fpm?

In php-fpm, there is a constant increase in RAM consumption, ~ + 1% per day.
And after 3 weeks you have to restart the server due to lack of RAM.
I noticed this when I typed top in the terminal:

466 root      20   0  469980  43080  35132 S   0.0  0.4   1:08.70  `- php-fpm: master process (/opt/plesk/php/7.1/etc/php-fpm.conf)             
  909 web  20   0 1610096 1.121g  27336 S   0.3  9.8  25:50.36      `- php-fpm: pool сайт                                          
  911 web  20   0 1609788 1.119g  25584 S   0.7  9.7  26:15.04      `- php-fpm: pool сайт

This is the first time I've come across this, why can this happen, why don't they close for so long? Prompt in what direction to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2020-09-13
@celovec

Set pm.max_requeststo recreate processes after a certain number of processed requests.

R
Roman Mirilaczvili, 2020-09-13
@2ord

I believe that the memory is not released due to the fact that its consumption is caused by an increase in the number of HTTP connections, with a DBMS, or something else.
You need to profile the application to know the reason.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question