S
S
Slash2018-05-17 05:17:29
linux
Slash, 2018-05-17 05:17:29

How to reduce the load on RAM in Linux (VPS)?

Hello.
RAM: 991 MiB
OS: Ubuntu 16
Nginx + Apache (php)
The problem is that RAM is constantly filling up, it fills up instantly, 300 megabytes can fill up in 20 minutes. As soon as ~ 70 megabytes of free space remains, I can get a site crash and an error in the log like this:

[Fri May 11 16:04:32.369104 2018] [mpm_itk:error] [pid 3620] child died with signal 7

At the moment, I added a command to the scheduler (every 20 minutes):
sync; echo 3 > /proc/sys/vm/drop_caches
But this seems like a bad decision to me...
I don’t think it’s worth sinning about a memory leak in PHP, since the attendance is not large, and even in 20 minutes, 300 mb would be wrong leaked ...
Tell me, how can I reduce the load on the RAM? Or at least make sure that there is always free space in memory, even 300 mb.
free -m at the time of writing:
total        used        free      shared  buff/cache   available                                    
Mem:            991         518         198          87         275         233                                    
Swap:             0           0           0

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Reversaidx, 2018-05-17
@Reversaidx

Stuck errors are related, with memory shortages called OOMKiller, you don't have that.
The fact that the free parameter is decreasing is not a bug, a problem or something special (this is normal for Linux due to active caching).
First of all, I would remove the outdated ITK, install Prefork instead, limit the maximum number of clients to the web server. If precompilation modules like Xcache are installed, you can try to remove them (in the case of Xcache, try to replace them with Opcache)

V
Valentine, 2018-05-24
@ProFfeSsoRr

Firstly, I advise you to read https://habr.com/post/53236/
Secondly, see what happens after the first step :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question