SOLVED Long-running MySQL queries

Mugoma

Well-Known Member
Aug 1, 2016
74
4
8
Nairobi
cPanel Access Level
Root Administrator
We are experiencing high load since about 4 days ago.

We realised MySQL seems to be one of the causes.

In particular we're seeing this long-running query:

SELECT TABLE_SCHEMA as DB,SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) AS SPACEUSED from information_schema.ta


This seems to be a query run by cPanel. How can we eliminate it or reduce frequency?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello @Mugoma,

You can disable the following option under the SQL tab in WHM >> Tweak Settings to disable this activity:

Use INFORMATION_SCHEMA to acquire MySQL disk usage

Per the option description:

Using INFORMATION_SCHEMA ensures that disk usage by MySQL tables is included in totals. However, enabling this option may cause a significant drop in performance as MySQL may become unresponsive until data collection is complete. Disabling this option causes the system to query the filesystem directly, potentially excluding disk space used by some database tables. Note: If you use a remote MySQL server, you must turn this setting On in order to calculate MySQL disk usage.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.