I
I
Ivan Promin2019-01-31 13:01:20
Apache HTTP Server
Ivan Promin, 2019-01-31 13:01:20

Why does the memory consumption on the server not fall after the completion of all scripts?

Good afternoon.

We will not understand why the memory consumption does not drop after the script ends.
There is no traffic to the site, HTOP information We upload 5c52cb52b09b6384717996.png

4 thousand products to the site, consumption grows 5c52c7bba82e9310895279.png
Then it does not fall, and at the next upload - an error of lack of memory.

Brief specifications
CPU: 2 RAM: 2 GB SSD: 30 GB
Ubuntu 16.04
Vesta

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
neol, 2019-01-31
@sweetcode

Memory consumption and should not fall. PHP (like any other high-level PL) will not give the operating system memory that it has used at least once, because it may still be needed for similar requests and there is no point in driving it back and forth.
To solve the problem in your case, I see 3 options:

  1. decrease MaxRequestsPerChild so that processes restart more often
  2. limit the number of parallel requests ( MaxClients ) so that there is enough memory
  3. transfer the processing of goods to background tasks launched from the cli

I
Ivan Promin, 2019-02-01
@sweetcode

So far, adding RAM to 4GB saves

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question