Information schema and diskspace used query

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
Any way to make this query that is run due to diskspace calcualtion of mysql each day to run at non busy times:

| 82075 | root | localhost | mysql | Query | 89 | Opening tables | SELECT TABLE_SCHEMA as DB,SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) AS SPACEUSED from information_schema.ta | 0.000 |


What script is that? is it a cronjob?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
49
28
India
cPanel Access Level
Root Administrator
Twitter
Are you getting any issues with the mysql load.

You can go with the mysql governor if you are using the cloudlinux.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

That process stems from the following option under the "SQL" tab in "WHM >> Tweak Settings":

Use INFORMATION_SCHEMA to acquire MySQL disk usage

Per it's 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.

You can disable this option, or modify the following root cron job using the "crontab -e" command if you prefer to keep it enabled and have the database disk space usage process ran at a specific time of the day:

Code:
30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
Thank you.
 

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
Are you getting any issues with the mysql load.

You can go with the mysql governor if you are using the cloudlinux.
We like to run things like this all during the night and not during the day. We have many servers with many databases on it so best to perform this.

We planning optimization strategies currently.

@cPanelMichael - Thanks man
 
  • Like
Reactions: cPanelMichael