Articles in this section

How disk usage is calculated by Plesk

Plesk for Windows kb: how-to Plesk for Linux ABT: Group B

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How disk usage is calculated by Plesk?

Answer

Disk usage calculation is performed during the Plesk daily maintenance task:

  • The calculation of the used disk space for files is performed through the utility DU
  • For databases, the information from the MySQL database is used
  • For mail, the index files of the mailboxes are used

Note: Since the calculation is performed once a day, the actual information may not be displayed immediately after changes are made (for example, uploading new files, adding data to the database, or new email messages in the inbox)

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))

 

To find out what is included in the disk usage calculation of a subscription, in Plesk go to Tools & Settings > Server Settings:


These values are stored in the Plesk database in bytes (in binary)
  1. Find the subscription id:

    # plesk db "select id,name from domains where name='example.com'"
    +----+-------------+
    | id | name        |
    +----+-------------+
    | 3  | example.com |
    +----+-------------+

  2. 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 |
+--------+--------+-----------+--------+

 

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.