當 Plesk 用戶創建一個訂閱時,Plesk 會開始計算其使用的磁碟空間容量。潛在消耗磁碟空間的主要有以下幾類:

  • (總是包括)網站、FTP 和 web 使用者的內容(包括日誌檔和統計報告)。
  • 資料庫
  • 遠端資料庫。
  • 郵箱。
  • Java 應用程式。
  • 郵寄清單。
  • 訂閱備份檔案。
  • 作為伺服器級備份一部分的訂閱備份。

本小節闡述 Plesk 如何計算 Linux 和 Windows 上每個部分使用的磁碟空間容量。如果要在計算磁碟空間容量時包括或排除某些選項,請進入 工具與設定 > 伺服器設定 頁面。

總的磁碟空間使用容量可在 工具與設定 > 總結報告 。總結報告會顯示所有訂閱使用的總磁碟空間容量。

如果您想要按訂閱查看磁碟空間使用情況,請進入  訂閱 ,點按訂閱名稱並切換到 經典 查看模式(點按 image 75739 圖示並點按 經典模式 )。主域名、其它域名和子域名的磁碟空間使用情況將會在  磁片使用  欄中顯示。

image 75734

子域名和其它域名內容佔用的磁碟空間會算入主域名的磁碟空間使用量中。

子域名或其它域名計算的磁碟空間使用量值通常比較低,只包括域名配置和日誌等的系統檔。

變數

接下來我們會使用以下變數簡化描述:

  • 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.

變數值會根據作業系統而變化。在 Linux 上,您可以在 /etc/psa/psa.conf 中找到這些值。

網站內容、匿名 FTP 內容、網站使用者的內容

該類別內容總是包括在磁碟空間使用量計算內。

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

在 Linux 上,網站內容的大小是以下目錄的總大小:

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

在 Windows 上,匿名 FTP 內容的大小是以下目錄的總大小:

%plesk_vhosts%\<domain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<subdomain_name>\anon_ftp
%plesk_vhosts%\<domain_name>\<addon_domain_name>\anon_ftp

在 Linux 上,匿名 FTP 內容的大小是以下目錄的總大小:

HTTPD_VHOSTS_D/<domain_name>/anon_ftp

在 Windows 上,網站使用者內容的大小是以下目錄的總大小:

%plesk_vhosts%\<domain_name>\web_users
%plesk_vhosts%\<domain_name>\<subdomain_name>\web_users
%plesk_vhosts%\<domain_name>\<addon_domain_name>\web_users

在 Linux 上,網站使用者內容的大小是以下目錄的總大小:

HTTPD_VHOSTS_D/<domain_name>/web_users

備註: 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.

日誌檔和統計報告

在 Windows 上,統計報告的大小是以下目錄的總大小:

%plesk_vhosts%\<domain_name>\.plesk\statistics
%plesk_vhosts%\<domain_name>\<subdomain_name>\.plesk\statistics
%plesk_vhosts%\<domain_name>\<addon_domain_name>\.plesk\statistics

在 Windows 上,日誌的大小是以下目錄的總大小:

%plesk_vhosts%\<subscription_name>\logs

在 Linux 上,日誌檔和報告的大小是以下目錄的總大小:

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.

資料庫

先計算單個網站的資料庫大小,然後再計入總大小中。

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.

遠端資料庫

您可以把遠端主機上的資料庫計入磁碟空間使用量中。在 Linux 上,只會包括遠端 MySQL 資料庫( 遠端 MySQL 資料庫 選項)。在 Windows 上,會把任何類型的遠端資料庫計算在內( 遠端資料庫 選項)。

郵箱

每個網站的郵箱大小是這些郵箱對應的目錄的總大小。郵箱的路徑根據資訊傳輸代理不同而不同(例如,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 應用程式

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.

備份檔案

在 Linux 上,可通過以下工具調用獲取備份大小:

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 – 如果備份是管理員所有。

/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.

計算總的磁碟空間使用容量

計算總的磁碟空間使用容量的公式如下:

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.