Question
How disk usage is calculated by Plesk?
Answer
Note: Disk usage displayed in Plesk is updated once a day during the Plesk daily maintenance task.Â
The disk usage is displayed on the domains Statistics page:
Power User view:
- Plesk > Statistics
Service Provider view:
- Plesk > Subscriptions > example.com >Â View More Statistics (Under Hosting)
Â
These values are stored in the Plesk database in bytes (in binary).
-
Find the subscription id:
# plesk db “select id,name from domains where name=’example.com'”
+—-+————-+
| id | name    |
+—-+————-+
| 3Â | example.com |
+—-+————-+ -
Find its overall disk usage:
# plesk db “SELECT SUM(real_size) FROM domains d WHERE d.id=3“
+—————-+
| SUM(real_size) |
+—————-+
| 59314176Â Â Â Â |
+—————-+
Â
Overall disk usage is divided into four groups of services:
- Web (httpdocs, subdomains, web_users and all other data, not included in Mail, Databases, Other)
- Mail (mailboxes, maillists)
- Databases (dbases)
- Other (anonftp, logs, domaindumps, configs, chroot)
Â
Information about the size of these four services is stored in the “disk_usage” table of the psa database. Run the following command to get them:
# plesk db “SELECT SUM(httpdocs) + SUM(httpsdocs) + SUM(subdomains) + SUM(web_users) AS Web, 0 + SUM(mailboxes) + SUM(maillists) AS Mail, 0 + SUM(dbases) AS ‘Databases’, SUM(anonftp) + SUM(logs) + SUM(domaindumps) + SUM(configs) + SUM(chroot) AS Other FROM disk_usage AS disk_usage INNER JOIN domains AS domains ON domains.id = disk_usage.dom_id WHERE dom_id=3;”
+——–+——–+———–+——–+
| Web  | Mail  | Databases | Other |
+——–+——–+———–+——–+
| 856064 | 143360 | 58150912Â | 163840 |
+——–+——–+———–+——–+
Â
To find out what is included in the disk usage calculation of a subscription, in Plesk go to Tools & Settings > Server Settings: