After you enable the log analysis feature, you can modify the log storage capacity or delete all stored logs.
Background information
You can increase or decrease the log storage capacity based on your business requirements. For more information, see Increase the log storage capacity and Decrease the log storage capacity. If you enable log collection for a new website, the required log storage capacity increases. If you reduce the log storage duration, the log storage capacity that is required for the same business scale decreases.
Prerequisites
The log analysis feature is enabled. For more information, see Use the log analysis feature.
Method to calculate the required log storage capacity
The following example shows how to estimate the required log storage capacity based on the daily queries per second (QPS) of your website:
In most cases, each request log occupies approximately 2 KB of storage. If the average QPS of your website is 500, the required storage for the logs that are generated within a day is 86,400,000 KB, which is approximately 82 GB. This value is calculated by using the following formula: 500 × 60 × 60 × 24 × 2 = 86,400,000. If you want to store logs that are generated within 180 days, the required log storage capacity is 15,552,000,000 KB, which is approximately 14.5 TB. This value is calculated by using the following formula: 86,400,000 × 180 = 15,552,000,000.
Method to handle exhausted log storage
If the log storage is exhausted, new logs cannot be stored and are lost. To resolve this issue, you can perform one of the following operations:
(Recommended) Increase the log storage capacity. For more information, see Increase the log storage capacity.
Delete stored logs and reduce the log storage duration. For more information, see Delete logs and Change the storage duration of logs.
ImportantIf you perform this operation, all logs are deleted and cannot be recovered. Before you delete the stored logs, make sure that you no longer need the logs.
Each Alibaba Cloud account can delete stored logs twice. We recommend that you do not frequently delete logs. If the log storage capacity cannot meet your business requirements, we recommend that you increase the log storage capacity at the earliest opportunity.
Query the log storage capacity
Query the log storage usage. If the log storage is about to be exhausted, you can click Upgrade to expand the log storage capacity. Alternatively, you can click Delete to delete the logs that you no longer require.
The log storage usage displayed in the Anti-DDoS Proxy console is not updated in real time. The displayed value does not include the usage from the most recent 2 hours.
After you enable the log analysis feature, a log analysis instance is provided. During the validity period of the log analysis instance, Anti-DDoS Proxy provides the alert feature for log analysis by default. You do not need to manually enable the alert feature. If the log storage usage exceeds 80%, Message Center sends an alert to you on a daily basis. In this case, you can increase the log storage capacity or clear the stored logs. If the log storage usage falls below 80% after you perform one of the preceding operations, Message Center stops sending an alert to you.
We recommend that you regularly check the log storage usage when you use the log analysis feature. To ensure that new logs can be stored, we recommend that you expand the log storage capacity when the log storage usage exceeds 70%. If a specific amount of log storage remains idle for a long period of time, you can reduce the log storage capacity.
Increase the log storage capacity
If the log storage capacity cannot meet your business requirements, you can increase the log storage capacity.
Log on to the Anti-DDoS Proxy console.
In the top navigation bar, select the region of your instance.
Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Proxy (Chinese Mainland) instance, select Chinese Mainland.
Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Proxy (Outside Chinese Mainland) instance, select Outside Chinese Mainland.
In the left-side navigation pane, choose
.In the upper-right corner of the Log Analysis page, click Upgrade.
On the Upgrade/Downgrade page, select a log storage capacity that is greater than the current capacity, read DDoS Log Service Terms of Service, and then select I have read and agree DDoS Log Service Terms of Service.
Example: If the current log storage capacity is 3 TB, you can select 5 TB or higher.
Click Buy Now and complete the payment.
After the log storage capacity is increased, you can view the new log storage capacity and usage in the upper-right corner of the Log Analysis page.
Decrease the log storage capacity
If the log storage capacity exceeds your business requirements, you can decrease the log storage capacity.
Log on to the Anti-DDoS Proxy console.
In the top navigation bar, select the region of your instance.
Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Proxy (Chinese Mainland) instance, select Chinese Mainland.
Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Proxy (Outside Chinese Mainland) instance, select Outside Chinese Mainland.
In the upper-right corner of the Log Analysis page, click Downgrade.
On the Downgrade page, select a log storage capacity that is less than the current capacity, read DDoS Log Service Terms of Service, and then select I have read and agree DDoS Log Service Terms of Service.
Example: If the current log storage capacity is 10 TB, you can select 5 TB or lower.
Click Buy Now and complete the payment.
After the log storage capacity is decreased, you can view the new log storage capacity and usage in the upper-right corner of the Log Analysis page.
Delete logs
If you do not want stored logs to occupy your log storage, you can delete the logs. After you delete the logs, all logs that are stored are deleted.
Log on to the Anti-DDoS Proxy console.
In the top navigation bar, select the region of your instance.
Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Proxy (Chinese Mainland) instance, select Chinese Mainland.
Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Proxy (Outside Chinese Mainland) instance, select Outside Chinese Mainland.
In the left-side navigation pane, choose
.In the upper-right corner of the Log Analysis page, click Delete.
ImportantIf no logs are stored, the Delete operation is not supported.
In the Are you sure that you want to delete all logs message, click OK.
Each Alibaba Cloud account can delete stored logs twice. We recommend that you do not frequently delete logs. If the log storage capacity cannot meet your business requirements, we recommend that you increase the log storage capacity at the earliest opportunity.
ImportantYou cannot recover the logs that you delete. Proceed with caution.
After you delete the logs, you must wait for 2 to 3 hours before you can view the result in the upper-right corner of the Log Analysis page.