Articles in this section

How to find disk space usage of a domain / subscription / customer / reseller in Plesk?

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to find disk space usage of a domain / subscription / customer / reseller in Plesk?

Answer

Web Pro and Web Host editions
  • To view the disk space usage of a subscription, log in to Plesk and go to Subscription > example.com > Websites & Domains > More Statistics > Disk Space and Traffic.



     

    Alternatively, go to Domains and use the search bar to find the required domain and view its Disk Usage:



     

    Note: The disk space taken by subdomains and additional domains on the subscription is included in the disk space usage of the main domain of the subscription. To view the disk space usage of a specific domain/subdomain, see the command-line instructions.

     

  • To view the disk space usage of all domains of a customer or a reseller:
    1. Log in to Plesk.
    2. Go to Tools & Settings > Summary Report.


      Screenshot_2019-06-12_Tools_Settings_-_Plesk_Onyx_17_8_11.png
       

    3. Select Full Report from the drop-down menu and scroll down to domains/customers/resellers.


      Screenshot_2019-06-12_Plesk_Onyx_17_8_11.png
       

    4. Scroll down to the Customers section.



       

      Note: To sort all customers by their disk space usage, see command-line instructions.

      To add the functionality to sort subscriptions and customers in Summary Report, vote for this feature request:

Web Admin edition

 

To view the disk space usage of a webspace, log in to Plesk and go to Statistics > example.com.

Note: The disk space taken by subdomains and additional domains is included in the disk space usage of the main domain. To see the disk space taken by specific domain/subdomain, see the command-line instructions.

Command-line interface
  1. Connect to your Plesk server via SSH.
  2. Access the Plesk database:

    # plesk db

    Note: On Windows Server, start a command prompt as an Administrator.

  3. Use these the SQL queries:
    • to list all subscriptions sorted by disk space usage:

      MYSQL_LIN: SELECT name AS 'Subscription Name',round(real_size/1024/1024) AS 'Disk Usage (MB)' FROM domains WHERE webspace_id=0 ORDER BY real_size DESC;

      Sample output:

      CONFIG_TEXT: +-------------------+-----------------+
      | Subscription Name | Disk Usage (MB) |
      +-------------------+-----------------+
      | example.com       | 220             |
      | example.net       | 76              |
      | example.org       | 0               |
      +-------------------+-----------------+

    • to list all customers sorted by disk space usage:

      MYSQL_LIN: SELECT `Customer Username`, SUM(`Disk Usage (MB)`) AS 'Total Disk Usage (MB)'
          FROM (
              SELECT c.login AS 'Customer Username', ROUND(d.real_size/1024/1024) AS 'Disk Usage (MB)'
              FROM domains d, clients c
              WHERE d.cl_id=c.id AND d.webspace_id=0 AND c.type='client'
          ) AS subquery
          GROUP BY `Customer Username`
          ORDER BY `Total Disk Usage (MB)` DESC;

      Sample output:

      CONFIG_TEXT: +-------------------+-----------------------+
      | Customer Username | Total Disk Usage (MB) |
      +-------------------+-----------------------+
      | john_doe          | 289                   |
      | jane_roe          | 75                    |
      +-------------------+-----------------------+

    • to list disk space usage of
      • a domain:

        # plesk db " SELECT round(SUM(real_size)/1024/1024,2) as 'Disk Usage (MB)' FROM domains d WHERE d.id=(SELECT id FROM domains WHERE name='example.com');"

      • a subdomain:

        # plesk db " SELECT round(SUM(real_size)/1024/1024,2) as 'Disk Usage (MB)' FROM domains d WHERE d.id=(SELECT id FROM domains WHERE name='one.example.com');"

      • an additional domain:

        # plesk db " SELECT round(SUM(real_size)/1024/1024,2) as 'Disk Usage (MB)' FROM domains d WHERE d.id=(SELECT id FROM domains WHERE name='example2.com');"

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.