We have a big Database, It is about 750G. And also for replication this is our Master DB
and we have 4 slaves, 3 of them are sync without delay, and one of them has 2 hours delay.
OS : Ubuntu 16.04 DB : MariaDB 10.2.9 app : php 7
Sometimes mysql thread increase suddenly (about 5k) without any reason, by chance I found that if I stop one of first three servers slave trough stop slave
it can decrease the threads to normal numbers (around 500), and start slave by star slave
after 1 minute or more.
Every time Mysql threads goes up more than 4000 in a second I should use :
stop slave; start slave;
on every server ! and this is not good solution!
*** And even worse cases, stop slave; start slave;
won't work and Mysql threads is going up more than 10K and I should stop and start Master database Mariadb ( I mean systemctl stop mysql && systemctl stop mysql
) and it is clear that at that time my application is not reachable by users!
My questions are :
-1 : what is the reason of this accidents ?
-2 : what is temporary solution ?
-3 : will something like maxscale
help me in this scenario or not
-3.1 : If yes how does maxscale
will help me ?
-4 : what is the best solution for my problem, how can I trace the issue ?