sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
5.95k stars 970 forks source link

High SWAP memory usage #3200

Open nfurmanczak opened 3 years ago

nfurmanczak commented 3 years ago

Hello,

i am using 2x ProxySQL nodes (nativ cluster) in galera native cluster mode with a PXC 5.7 cluster.

ProxySQL version: 2.0.15-1.1.stretch OS: Debian 9.13 (Kernel 4.9.240-2) as VM Specs: 2vCPUs, 4GB vRAM, 50GB disk space

I have noticing that both ProxySQL nodes are using the entire 600MB SWAP memory after 10 to 14 days, even when there is still enough free RAM. For testing, I set the vm.swappines value from 5 to 1 and deactivated THP (transparent huge pages). However, this had no noticeable effect on the SWAP memory.

I use a very simple ProxySQL configuration without any qu

ery rules. The current workaround is to restart the ProxySQL service every few days.

Do you need any more information about my configuration? Do I have any errors in my configuration or can I improve something?

kind regards Nikolai

proxysql_mem

proxysql_config.txt

renecannao commented 3 years ago

I have noticing that both ProxySQL nodes are using the entire 600MB SWAP memory after 10 to 14 days, even when there is still enough free RAM.

Please note that ProxySQL doesn't control this, therefore it is your OS that decides to swap it. From the output of stats_memory_metrics it seems proxysql has mapped only ~580MB of memory, and only ~550 resident: it doesn't seem proxysql is using a lot of memory and therefore forced to swap. This seems mostly a OS issue.

The current workaround is to restart the ProxySQL service every few days.

This is a drastic solution. Maybe a swapoff + swapon is less disruptive, but still a workaround