All Products
Search
Document Center

Anti-DDoS:Manage log storage capacity

Last Updated:Mar 19, 2024

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.

    Important
    • If 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 Clear to delete the logs that you no longer require.

    The log storage usage displayed in the Anti-DDoS Proxy (Chinese Mainland) console is not updated in real time. The displayed value does not include the usage from the most recent 2 hours.

    Note

    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.

  1. Log on to the Anti-DDoS Proxy console.

  2. 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), select Outside Chinese Mainland.

  3. In the left-side navigation pane, choose Investigation > Log Analysis.

  4. In the upper-right corner of the Log Analysis page, click Upgrade.

  5. On the Upgrade/Downgrade page, select a log storage capacity that is greater than the current capacity, and then read and select DDoS Log Service Terms of Service.

    Example: If the current log storage capacity is 3 TB, you can select 5 TB or higher.

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

  1. Log on to the Anti-DDoS Proxy console.

  2. 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), select Outside Chinese Mainland.

  3. In the left-side navigation pane, choose Investigation > Log Analysis.

  4. In the upper-right corner of the Log Analysis page, click Downgrade.

  5. On the Upgrade/Downgrade page, select a log storage capacity that is less than the current capacity, and then read and select Log Service Terms of Service.

    Example: If the current log storage capacity is 10 TB, you can select 5 TB or lower.

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

  1. Log on to the Anti-DDoS Proxy console.

  2. 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), select Outside Chinese Mainland.

  3. In the left-side navigation pane, choose Investigation > Log Analysis.

  4. In the upper-right corner of the Log Analysis page, click Clear.

    Important

    If no logs are stored, the Clear operation is not supported.

  5. In the Are you sure to clear 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.

    Important

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