About Disk Space Usage Calculation

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 > Summary Report. The summary report shows the sum of disk space consumption of all subscriptions.

If you would like to view the disk space usage per subscription, go to  Subscriptions, click a subscription name and switch to the Classic List view mode (click the image-75739.png icon and select Classic List). 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-75734.png

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.
  • CATALINA_HOME is the absolute path to the Tomcat installation directory.
  • 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%\<domain_name> 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 databases is the sum of data length and index length in the following query: SHOW TABLE STATUS FROM <db_name>.

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/<db_oid>. Here db_oid stands for OID of a database under a certain website.

On Linux, the size of MySQL databases is the size of the directory MYSQL_VAR_D/<db_name>. 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 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) <mailbox_dir>\<domain_name>\MAILROOT\<mailbox_name>. The mailbox_dir is stored in the Windows registry HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mail Enable\Mail Enable\Connectors\SF.
  • (Windows, SmarterMail) <mailbox_dir>\Users\<mailbox_name>. The mailbox_dir is obtained by calling the GetDomainSettings method of the svcDomainAdmin web service.
  • (Linux) PLESK_MAILNAMES_D/<domain_name>.

We will refer to the total mailboxes size as MAILBOXES in the formula for calculating the total disk space usage.

Java Applications

On Windows, the total size of Java applications is the size of the directory CATALINA_HOME\psa-wars\<domain_name>. Here CATALINA_HOME is the value of the InstallPath parameter in the Windows registry, in HKLM\SOFTWARE\Apache Software Foundation\Tomcat\<Tomcat_version>.

On Linux, the directory with Java content is CATALINA_HOME/psa-wars/<domain_name>.

We will refer to this total as JAVA_APPS in the formula for calculation 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\<backups_dir>\<domain_name>\.discovered\*\.

The backups_dir is:

/domains – if the backups are owned by the administrator.

/resellers/<reseller_username>/domains – if a website is owned by a reseller.

/resellers/<reseller_username>/clients/<customer_username>/domains – if a website is owned by a customer of some reseller.

/clients/<customer_username>/domains – if a website is owned by a customer directly under the administrator.

If the file %plesk_dir%Backup\dumps_dir\<domain_name>\.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)

+ JAVA_APPS (if the Java applications 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.