This topic describes how to track resource consumption, optimize resource usage, and reduce costs.

You can use the following items to manage costs:
  • Bill details: You can view bill details on the Billing Management page of the Alibaba Cloud Management Console.
  • Usage records: Each usage record contains the complexity and metering information of an SQL statement, as well as details about daily storage and download traffic.
  • Command-line interface (CLI): You can use a CLI to reproduce operation scenarios and determine the causes of high costs incurred by SQL statements.

Bill details

We recommend that you regularly view your bills to optimize costs in a timely manner. You can view bill details in the Alibaba Cloud Management Console. If you select the subscription billing method, bills are generated at 12:00 the next day. If you select the pay-as-you-go billing method, bills are generated at 09:00 the next day. For more information, see View billing details.

Usage records

If the bill amount of a project reaches thousands of dollars on a given day and is a multiple of the normal bill amount, you must view the bill details. You can download usage records to view details about exception records. For more information, see View billing details.

Metering information about a storage fee is pushed every hour. To calculate a storage fee, obtain the total number of bytes and calculate the average value over a 24-hour period. Then, use the tiered pricing method to obtain the storage fee.

The calculation of metering information depends on the end time of each task. If a task is complete in the early morning of the next day after it starts, the metering information of this task is included in the calculation for the day the task is complete.

You are not charged for the resources that are used to download data over an internal network, such as the classic network. The resources that are used to upload data are also free of charge. You are charged only for the resources that are used to download data over the Internet.

CLI

If an abnormal SQL statement is detected, you can use a CLI to reproduce the operation scenario.
  • You can check usage records or run the show p; command to obtain the ID of the instance on which abnormal data is detected. Then, run the wait InstanceId command to obtain the Logview URL of the instance. The logs of the SQL statement are displayed in Logview. You can view the logs to determine the causes of high costs.
    Note You can obtain information generated only in the last seven days in Logview.
  • You can also run the desc instance instid command to show information about the SQL statement in the console.