Mysql server getting slower

Operating System & Version
cloudlinux version 8.7.0 standard
cPanel & WHM Version
104.0.11

charliecres

Well-Known Member
Mar 5, 2020
49
3
8
Dhaka
cPanel Access Level
Root Administrator
here is my my.cnf


[mysqld]
sql_mode = "NO_ENGINE_SUBSTITUTION"
disable-log-bin = 1
default-authentication-plugin = mysql_native_password
performance-schema = 0
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
log-error = /var/log/mysqld.log
pid-file = /var/run/mysqld/mysqld.pid
innodb_buffer_pool_size = 134217728
max_allowed_packet = 268435456
open_files_limit=80000
innodb_file_per_table = 1
mysqlx = 0




and here is MySQL process




IdUserHostdbCommandTimeStateInfo
5event_schedulerlocalhostNULLDaemon111Waiting on empty queueNULL
94sgxy_surapplocalhostsgxy_surappSleep91NULL
110rootlocalhostNULLSleep27NULL
341weon_Da1localhostweon_Da1Sleep9NULL
395rootlocalhostNULLQuery0initSHOW PROCESSLIST



suddenly MySQL server getting too much slow. how can I fix this permanently? is there anything wrong or need to add at my.cnf?
 
Last edited by a moderator:

charliecres

Well-Known Member
Mar 5, 2020
49
3
8
Dhaka
cPanel Access Level
Root Administrator
and right now here MySQL® Processes !!





IdUserHostdbCommandTimeStateInfo
5event_schedulerlocalhostNULLDaemon7290Waiting on empty queueNULL
72rootlocalhostNULLSleep17NULL
45766bes_steolocalhostbes_steoSleep1NULL
50445bes_steolocalhostbes_steoExecute293Waiting for table metadata lockinsert into `tblemails` (`userid`, `date`, `to`, `cc`, `bcc`, `subject`, `message`, `pending`, `fail
50988bes_seolocalhostbes_seoExecute245Waiting for table metadata lockselect * from `tblemails` where `pending` = 1 limit 25
51153babu_w61localhostbabu_w61Sleep226NULL
51676mad_hostlocalhostmad_hostSleep130NULL
52013ytpa_bestlocalhostytpa_bestSleep2NULL
52226wek_Use1localhostwek_Use1Sleep29NULL
52349rootlocalhostNULLQuery0initSHOW PROCESSLIST
 

kernow

Well-Known Member
Jul 23, 2004
1,031
62
178
cPanel Access Level
Root Administrator
While its not perfect, the "Edit SQL Configuration" in WHM can give you a reasonable set of variables to use.
Note! don't use if your MySQL server has been up for < 48 hours.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
942
421
363
cPanel Access Level
DataCenter Provider
The issue does not appear to be MySQL itself, it's something with the bes account and the tblemails table. Something (which is odd that it's not showing) is holding a lock on that table, so the other processes can't process. That's typically not a config issue, it's a coding to database design issue.

Can you run "describe tblemails;" so we can see the table structure?
 

charliecres

Well-Known Member
Mar 5, 2020
49
3
8
Dhaka
cPanel Access Level
Root Administrator
The issue does not appear to be MySQL itself, it's something with the bes account and the tblemails table. Something (which is odd that it's not showing) is holding a lock on that table, so the other processes can't process. That's typically not a config issue, it's a coding to database design issue.

Can you run "describe tblemails;" so we can see the table structure?
"bash: describe: command not found"


and the problem is MySQL server performance getting too much slower every morning!!
 

andrew.n

Well-Known Member
Jun 9, 2020
982
363
63
EU
cPanel Access Level
Root Administrator
Is it happening constantly or just in the morning?
what version of MySQL do you have?
 

mtindor

Well-Known Member
Sep 14, 2004
1,511
136
343
inside a catfish
cPanel Access Level
Root Administrator
That table looks like it is probably a WHMCS table that holds / retains emails sent by WHMCS. And if your WHMCS has a lot of accounts, has been active for years, and/or has a lot of activity in it, that table can get pretty large (as well as a couple of other tables).

I would recommend checking the size of your tblemails table. It's probably pretty large. And you can prune it within WHMCS if indeed it is a WHMCS table.

WHMCS --> Utilities --> System --> System Cleanup --> Advanced --> Prune Saved Emails

M