When a Plesk user creates a subscription, Plesk starts calculating disk space usage for this entity. The disk space that can potentially be consumed is categorized into the following types: - (Always included) Website, FTP, and web users’ content (including log files and statistic reports). - Databases. - Remote databases. - Mailboxes. - Java applications. - Mailing lists. - Subscription backup files. - Subscription backups that are a part of server-level backups. This section explains how Plesk calculates disk space usage for each of these categories on Linux and on Windows. If you would like to include or exclude options from disk space calculation, you can do it on the **Tools & Settings** \> **Server Settings** page. The total disk space usage is available in **Tools & Settings** \> **Info and Statistics** (under “Server Management”). The summary report shows the sum of disk space consumption of all subscriptions. To view the disk space usage per subscription, go to **Subscriptions**, click the desired subscription, click **Set view**, and then click “On a separate page”. The disk space usage for a main domain as well as for additional domains and subdomains will be displayed in the **Disk Usage** column. image subscription disk usage The disk space occupied by content of subdomains and additional domains is included into the value of disk space usage calculated for the main domain. The value of disk space usage calculated for a subdomain or additional domain is usually low and includes only system files such as configuration and logs of the domain.
## Variables Next in this section we use the following variables to simplify the description: - `HTTPD_VHOSTS_D` is the absolute path to the directory with virtual hosts. - `PRODUCT_ROOT_D` is the absolute path to the Plesk installation directory. - `PLESK_MAILNAMES_D` is the absolute path to the directory with mailboxes. - `PGSQL_DATA_D` and `MYSQL_VAR_D` are the absolute paths to the directories with MySQL and PostgreSQL databases correspondingly. The variable values depend on the operating system. On Linux, you can find the values in `/etc/psa/psa.conf`.
## Website Content, Anonymous FTP Content, Web Users’ Content This category of content is always included in the calculation of disk space usage. On Windows, the size of website content is the total size of the `%plesk_vhosts%\` directory excluding these directories:
%plesk_vhosts%\<domain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<subdomain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<addon_domain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\web_users
%plesk_vhosts%\<domain_name>\<subdomain_name>\web_users
%plesk_vhosts%\<domain_name>\<addon_domain_name>\web_users
On Linux, the size of website content is the total size of the following directories:
HTTPD_VHOSTS_D/<domain_name>/cgi-bin
HTTPD_VHOSTS_D/<domain_name>/error_docs
HTTPD_VHOSTS_D/<domain_name>/httpdocs
HTTPD_VHOSTS_D/<domain_name>/<subdomain_name>
HTTPD_VHOSTS_D/<domain_name>/<addon_domain_name>
HTTPD_VHOSTS_D/system/<domain_name>/pd
On Windows, the size of anonymous FTP content is the total size of the following directories:
%plesk_vhosts%\<domain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<subdomain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<addon_domain_name>\anon_ftp
On Linux, the size of anonymous FTP content is the total size of the following directories:
HTTPD_VHOSTS_D/<domain_name>/anon_ftp
On Windows, the size of web users’ content is the total size of the following directories:
%plesk_vhosts%\<domain_name>\web_users
%plesk_vhosts%\<domain_name>\<subdomain_name>\web_users
%plesk_vhosts%\<domain_name>\<addon_domain_name>\web_users
On Linux, the size of web users’ content is the total size of the following directories:
HTTPD_VHOSTS_D/<domain_name>/web_users
Note If the directories mentioned above contain hard links, Plesk includes the size of each link in calculation only once, disregarding the number of the link instances.
We will refer to the total of website, FTP, and web users’ content as `WEB_CONTENT` in the formula for calculation the total disk space usage.
## Log Files and Statistic Reports On Windows, the size of statistic reports is the total size of the following directories:
%plesk_vhosts%\<domain_name>\.plesk\statistics
%plesk_vhosts%\<domain_name>\<subdomain_name>\.plesk\statistics
%plesk_vhosts%\<domain_name>\<addon_domain_name>\.plesk\statistics
On Windows, the size of logs is the total size of the following directory:
%plesk_vhosts%\<subscription_name>\logs
On Linux, the size of logs and reports is the total size of the following directories:
HTTPD_VHOSTS_D/system/<domain_name>/statistics
We will refer to the total logs and reports size as `LOG_AND_STAT` in the formula for calculation the total disk space usage.
## Databases The size of databases is calculated per website and then summed to obtain the total size. On Windows, the size of MySQL/MariaDB databases is the sum of data length and index length in the following query: `SHOW`` ``TABLE`` ``STATUS`` ``FROM`` ```. To get the size of MS SQL databases, the system runs the query `exec`` ``sp_databases` for each database under a particular website. The results are summed and multiplied by 1024. On Linux, the size of PostgreSQL databases is the total size of directories `PGSQL_DATA_D/base/`. Here `db_oid` stands for OID of a database under a certain website. On Linux, the size of MySQL/MariaDB databases is the size of the directory `MYSQL_VAR_D/`. Here `db_name` stands for a database name under a certain website. We will refer to the total databases size as `DATABASES` in the formula for calculation the total disk space usage.
## Remote Databases You can include databases on remote hosts into the calculation of disk space usage. On Linux, only remote MySQL/MariaDB databases can be included (the **Remote MySQL databases** option). On Windows, remote databases of any type can be included into the calculation (the **Remote databases** option).
## Mailboxes The size of mailboxes per website is the total size of directories corresponding to mailboxes. The path to a mailbox depends on a message transfer agent (for example, MailEnable). - (Windows, MailEnable) `\\MAILROOT\`. The `mailbox_dir` is stored in the Windows registry `HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mail`` ``Enable\Mail`` ``Enable\Connectors\SF`. - (Windows, SmarterMail) `\Users\`. The `mailbox_dir` is obtained by calling the `GetDomainSettings` method of the `svcDomainAdmin` web service. - (Linux) `PLESK_MAILNAMES_D/`. We will refer to the total mailboxes size as `MAILBOXES` in the formula for calculating the total disk space usage.
## Backup Files On Linux, the size of backups is obtained from the following utility call:
PRODUCT_ROOT_D/admin/bin/pmm-ras --get-domain-dumps-disc-usage --domain-guid <domain_guid> \
--session-path PRODUCT_ROOT_D /PMM/logs
If the administrator specifies to exclude website backups nested in server-level backups from user quota, the utility is run with an extra option, `--skip-server-dumps`. On Windows, the size of backups is cached and is the sum of numbers that follow `size_` in file names `size_xxxxxx`. These `size_` files are stored in `%plesk_dir%Backup\\\.discovered\*\`. The `backups_dir` is: `/domains` – if the backups are owned by the administrator. `/resellers//domains` – if a website is owned by a reseller. `/resellers//clients//domains` – if a website is owned by a customer of some reseller. `/clients//domains` – if a website is owned by a customer directly under the administrator. If the file `%plesk_dir%Backup\dumps_dir\\.discovered\*\ownertype_server` exists then the size of website backups nested in server-level backups is not added to the disk space usage. We will refer to the backups size as `BACKUPS` in the formula for calculation the total disk space usage.
## Calculating the Total Disk Space Usage The formula for calculating the total disk space usage is as follows: `TOTAL`` ``=`` ``WEB_CONTENT` `+`` ``LOG_AND_STAT` (if the **log files and statistic reports** option is selected in **Tools & Settings** \> **Server Settings**) `+`` ``DATABASES` (depends on the **databases** option on Linux and **MySQL databases** and **Microsoft SQL databases**) `+`` ``MAILBOXES` (if the **mailboxes** option is selected) `+`` ``BACKUPS` (if the **domain backup files** option is selected; the value depends on **backup files created by the administrator**) Here placeholders (for example, `WEB_CONTENT`) stand for the totals of respective categories.