L
L
lagudal2021-05-25 12:37:46
System administration
lagudal, 2021-05-25 12:37:46

What is the best way to optimize memory and swap in ubuntu server18.04?

Problem: on test servers, there is a constant lack of memory, and the servers periodically stop responding, only a forced reboot helps.
At the same time, the memory shows that a little more than half is occupied, and the swap is at zero. We increased the swap by 2.5 times - the same thing, not so fast, but it also completely eats up the swap, while there is still enough memory.
I saw that it is recommended to set the value vm.swappiness=10, but there is a caveat that this is good for desktop Linux, and for servers the default value of -60 may be optimal. I would experiment myself, but I do not have root rights for this.
From your experience, which is better?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2021-05-25
@ky0

It is necessary not to "optimize memory", but to limit the processes in terms of the occupied volume.

A
Artem @Jump, 2021-05-25
Tag

And what does memory optimization have to do with it if it is not enough?
Look for processes that require a lot of memory, and limit their appetites.

V
Vitaly Karasik, 2021-05-25
@vitaly_il1

Problem: on test servers, there is a constant lack of memory, and the servers periodically stop responding, only a forced reboot helps.
At the same time, the memory shows that a little more than half is occupied,

Then where is the confidence that the problem is in memory? Do you have CPU/IO monitoring?
What's in the logs?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question