Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Information schema and diskspace used query

Discussion in 'Database Discussions' started by sahostking, Jan 8, 2018.

  1. sahostking

    sahostking Well-Known Member

    Joined:
    May 15, 2012
    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Cape Town, South Africa
    cPanel Access Level:
    Root Administrator
    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?
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    604
    Likes Received:
    41
    Trophy Points:
    28
    Location:
    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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,516
    Likes Received:
    1,616
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  4. sahostking

    sahostking Well-Known Member

    Joined:
    May 15, 2012
    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Cape Town, South Africa
    cPanel Access Level:
    Root Administrator
    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
     
    cPanelMichael likes this.
Loading...

Share This Page