Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to view space disk usage of a domain / subscription / customer / reseller in Plesk
Answer
-
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 and find the required domain:
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, log in to Plesk > go to Tools & Settings > Summary Report > click on Summary Report and switch to Full Report > 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:
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.
-
Connect to the Plesk server via SSH.
-
Access the Plesk database:
# plesk db
Note: On Windows Server, start a command prompt as an Administrator.
-
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');"
-
-
Comments
0 comments
Please sign in to leave a comment.