Answer the question
In order to leave comments, you need to log in
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 this
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%
Answer the question
In order to leave comments, you need to log in
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>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question