G
G
globik2015-02-04 02:51:39
linux
globik, 2015-02-04 02:51:39

Why are all applications unloaded to swap when memory is empty (VPS OpenVZ)?

VPS on OpenVZ has 8 GB RAM and 4 GB swap. Debian 7 x64 system.
Faced such a problem: after restoring the database from a backup (.sql 14 GB), all applications are forced out into swap, and the memory is completely allocated for disk cache. Can you please tell me why this is happening and how to deal with it?
[email protected]~# htop (dropped to 0, 3MB on screenshot)
nLDPeTc.png[email protected]~# cat /proc/meminfo
OxpMMmv.pngScript northernmost.org/blog/find-out-what-is-using-your-swap
OzrODKl.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad Zhivotnev, 2015-02-04
@inkvizitor68sl

Do echo 3 > /proc/sys/vm/drop_caches
Better directly on the host.
If there is a swap on the hardware, then a part of your "virtual" swap will go to disk (vswap keeps swap in memory only as long as there is memory in principle).
It can be just a traditional glitch with the calculation of occupied memory in openvz, or it can be quite a glitch with memory allocation.

P
Puma Thailand, 2015-02-04
@opium

It can be seen on the top that all the memory is used. Why be surprised then?

A
Archie Kuznetsov, 2015-02-04
@Wolf4ara

Actually, this process can be regulated through overcommit:
catap.ru/blog/2009/05/05/about-memory-overcommit-memory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question