Answer the question
In order to leave comments, you need to log in
What to do if Memcached goes into swap?
Hello,
Can you tell me what to do if Memcached goes into swap? The virtual machine is running CentOS 7.2, Nginx, Memcached, Php-fpm, MariaDB and Bitrix. Resources allocated 8cpu, 12gb ram.
memcached settings:
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1024"
OPTIONS="-l 127.0.0.1"
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less
memcached 99000 kB
mysqld 17052 kB
swapoff -a && swapon -a
total used free shared buff/cache available
Mem: 12G 5,8G 631M 540M 6,1G 5,9G
Swap: 1,0G 163M 860M
Answer the question
In order to leave comments, you need to log in
What to do if Memcached goes into swap?
For 12GB of RAM, a 1GB swap looks a bit small.
But perhaps the situation will be saved by changing the swapinnes parameter.
The first thing that came across in Google: fx-files.ru/archives/704
It's okay that memcash put something in the swap - it just doesn't need it at the moment. You yourself see that almost half of your memory is not used in any way, which means that it fell into the swap only because it has not been used for a long time. Do not want something to get there - stupidly turn off the swap.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question