I see manytimes mysql is doing B_Counter = B_Counter+1 , cause the site hang...
[]
https://www.ubbdev.com/uploads/112530-mytop.gif[/]
low-priority-updates
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=20
Why I set max_connections to 20 (default 100) ? Because if I raise it , the queued connections (by update table lock) will become larger , cause site slower to recover (Under max 100 connections conditions , sometimes it takes more than 10+ minutes to recover ) ...
set-variable = wait_timeout = 30
Sometimes , there are many 'sleeping' connections , I set this so that there won't be so many sleeping connections occupying max_connections(20) ...
set-variable = join_buffer=1M
set-variable = sort_buffer=4M
set-variable = thread_cache_size=8
set-variable = table_cache=1024
set-variable = key_buffer=512M
set-variable = max_connect_errors=10000
set-variable = max_allowed_packet=1M
set-variable = record_buffer=2M