---
title: "Assessing Database disk usage on Acquia Cloud Platform"
date: "2025-02-06T01:27:40+00:00"
summary: "Check your Acquia Cloud database disk usage with MySQL queries or Drush commands—step-by-step guidance for Cloud Classic environments."
image:
type: "article"
url: "/acquia-cloud-platform/help/94621-assessing-database-disk-usage-acquia-cloud-platform"
id: "b3249627-2838-409d-a0c3-c017fd02c3f8"
---

Issue
-----

For environments running on [Cloud Platform](/node/55808 "https://docs.acquia.com/acquia-cloud-platform/overview") technologies, database layer utilization metrics are temporarily unavailable and will be added back as soon as possible, as pointed out in [Stack Metrics - Database Layer Metrics](/node/56407).

For environments running on [Cloud Classic](/node/55808 "https://docs.acquia.com/acquia-cloud-platform/overview") technologies, database layer utilization metrics are available.

This document guides you through the steps to find out the disk usage of your database by using a MySQL query. This query can be run by using either the **MySQL client**, or a `**drush**` command.

Resolution
----------

To find the database disk usage we use the MySQL `**SELECT**` query against the special `**table_schema**` table.

There are two methods presented here to retrieve the disk usage:

*   Using the MySQL client
*   Using the `drush sqlq` command

Note that there needs to be a conversion of the data from bytes to megabytes (MB).

Warning

The following methods depend on the MySQL `information_schema` data that is cached by the MySQL server for up to 24 hours. Therefore, the results might be out of date.  In Cloud Platform, this behavior cannot be changed.

If needed, running the `ANALYZE TABLE [table_name]` query can force MySQL to refresh this information for single tables but it can cause performance problems on busy databases. Use with caution.

### Using MySQL client

This assumes that you have connected through the MySQL client. Once you have connected, run this command:

    SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;

Example output:

    mysql> SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
    +----------------------------------+---------------+
    | DB Name                          | DB Size in MB |
    +----------------------------------+---------------+
    | b7aa71b3624148daa16f87b56a274a8f |         411.1 |
    | information_schema               |           0.2 |
    +----------------------------------+---------------+
    2 rows in set (0.09 sec)

### Using drush sqlq

This assumes that you have connected to your environment through SSH. Once connected, run the following command:

    # Edit the SITEHOSTNAME section.
    drush --uri=[SITEHOSTNAME] sqlq 'SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;'

Example query and output:

    mysite.prod@sshd-79a5cb2396-llj6z:/var/www/html/docroot/sites/default$ drush --uri=EDITME.MYSITE.COM sqlq 'SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;'
    b7aa71b3624148daa16f87b56a274a8f	387.1
    information_schema	0.2