M
M
Max2019-04-16 03:39:10
MySQL
Max, 2019-04-16 03:39:10

Why does MYSQL go into SWAP for 10GB with 20GB free RAM?

Good afternoon!
The problem is this - 64GB of RAM on the server, MYSQL goes to SWAP all the time, despite the fact that it is allocated 48GB for InnodbBuffer, and all the databases used together take about 45GB in total, and some of them are extremely rare (maybe several requests per day) .
After rebooting MYSQL, the memory starts to slowly increase and in a few hours from consumption on the server from 10GB it rises to 40GB, and no longer grows, then only in SWAP. Why?
It looks like thisaHU3zJTRTIC1bxQc6RoAoA.png

Or like this, to be precise
find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" -v TOTSWP="$(cat /proc/swaps | sed 1d | awk 'BEGIN{sum=0} {sum=sum+$(NF-2)} END{print sum}')" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") {used_swap=process["VmSwap"];sub(/[ a-zA-Z]+/,"",used_swap);percent=(used_swap/TOTSWP*100); printf "%10s %-30s %20s %6.2f%\n",process["Pid"],process["Name"],process["VmSwap"],percent} }' '{}' \;  | awk '{print $(NF-2),$0}' | sort -hr | head | cut -d " " -f2-
     29695 mysqld                                   4207592 kB  12.54%
     15645 Web Content                               183520 kB   0.55%
     22256 Web Content                               179788 kB   0.54%
     27618 VBoxSVC                                   153160 kB   0.46%
     23701 Web Content                               121528 kB   0.36%
      2061 gnome-shell                                99684 kB   0.30%
     22149 Web Content                                85684 kB   0.26%
     22067 firefox                                    76944 kB   0.23%
      7556 xfce4-taskmanag                            63716 kB   0.19%
     26915 nginx                                      29988 kB   0.09%

5cb523e9abdcf573975176.jpeg

Full mysql config and mysqltuner output

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lexa322, 2019-04-16
@lexa322

sysctl vm.swappiness = ?

R
Roman Mirilaczvili, 2019-04-16
@2ord

Everything is written in mysqltuner recommendations. You just need to read and understand.
It explains everything:

[--] Physical Memory     : <b>62.9G</b>
[--] Max MySQL memory    : <b>66.6G</b>

It is worth paying attention to the lines starting with [!!].
Why install a graphical environment on the production server and still run Firefox there?
I correctly understand that all this parsley works inside the VirtualBox virtual machine??

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question