All Products
Search
Document Center

MaxCompute:Best practices for planning and configuring elastically reserved CUs

Last Updated:Dec 05, 2023

This topic describes how to plan and configure subscription reserved compute units (CUs) and elastically reserved CUs in typical scenarios. You can refer to the best practices in this topic to reduce costs and improve operation efficiency.

Background information

MaxCompute allows you to configure custom quotas for subscription reserved CUs to allocate different number of CUs in different quotas during different periods. You can configure a maximum of three time periods. This significantly improves the utilization of computing resources. MaxCompute also provides elastically reserved CUs. You can purchase elastically reserved CUs and configure quota plans and time plans for the elastically reserved CUs based on business evaluation results to scale out or scale in computing resources. This way, costs are reduced and operation efficiency is improved.

Usage notes

Note

The prices in this topic are for reference. The actual prices are based on the product page.

  • To configure and use elastically reserved CUs, you must purchase subscription reserved CUs. The number of elastically reserved CUs that you configure cannot exceed the number of your subscription reserved CUs. You must purchase at least 50 CUs or a multiple of 50 CUs each time.

  • The unit price of elastically reserved CUs is USD 0.0488/CU/hour. The unit price of subscription reserved CUs is USD 22.0/CU/month. If an elastically reserved CU is used for over 16 hours every day in a 30-day month, the monthly fee of the elastically reserved CU is more than USD 23.424, which is calculated by using the following formula: 1 × 0.0488 × 16 × 30. In this case, we recommend that you purchase subscription reserved CUs rather than elastically reserved CUs.

  • Elastically reserved CUs are billed on a pay-as-you-go basis. Billing starts when scale-out is successful and ends when scale-in is successful. Metering data is pushed on the hour if you use elastically reserved CUs for more than one hour. Hourly bills are generated three hours after the billing cycle ends.

  • The evaluation methods used in the following scenarios are relatively simple. In the actual business implementation process, you must take all factors into consideration and perform debugging for a period of time to achieve the optimal configuration.

Scenario 1: Improve utilization of idle resources

Production projects consume most computing resources at night. For some business teams, data is time-sensitive, and computing output must be provided before a specified time point at night. Less computing resources are required in the daytime. A large number of subscription CUs are purchased to meet the business requirements at night. As a result, idle computing resources are available in the daytime.

The following figure shows the trend of daily CU usage in this scenario. In this example, 750 subscription reserved CUs are purchased to ensure that computing jobs during the peak hours of 03:00-08:00 can run as expected. The original monthly fee is USD 16,500, which is calculated by using the following formula: 750 × 22.0.资源闲置

Elastically reserved CU solution: Elastically reserved CUs can be used to meet business requirements in peak hours and reduce costs in off-peak hours. You can purchase 400 subscription reserved CUs and 350 elastically reserved CUs that are used for 5 hours (03:00-08:00). The following figure shows the trend of CU usage in a day. 资源闲置_弹性If you use the elastically reserved CU solution, the total monthly fee is USD 11,362, which is calculated by using the following formula: 400 × 22.0 + 350 × 0.0488 × 5 × 30. Compared with the solution that uses only subscription reserved CUs, the elastically reserved CU solution reduces the monthly fee by about 31%.

To configure elastically reserved CUs, perform the following steps:

  1. Log on to the MaxCompute console. In the top navigation bar, select a region.

  2. In the left-side navigation pane, choose Workspace > Quotas.

  3. Downgrade the quota.

    1. On the Quotas page, find the quota that you want to downgrade, and click the quota降配 icon in the Actions column. In the list that appears, select Downgrade.

    2. On the Downgrade page, change the number of CUs to 400.

    3. Read the terms of service, select the check box to confirm that you have read the terms of service, and then click Buy Now.

  4. Add a quota plan.

    1. On the Quotas page, find the quota that you want to manage and click Quota Configuration in the Actions column.

    2. On the Quota Configuration page, click the Quota Plans tab.

    3. On the Quota Plans tab, click Add Plan.

    4. In the Create Quota Plan dialog box, specify the plan name, and set the number of elastically reserved CUs to 350 for the level-1 quota.

    5. Allocate the number of elastically reserved CUs configured for the level-1 quota to the level-2 quota.

    6. Click OK.

  5. Configure a time plan.

    1. On the Quota Configuration page, click the Time Plans tab.

    2. On the Time Plans tab, click Edit Time Plan.

    3. In the Edit Time Plan dialog box, configure the items listed in the following table.

      Start time

      Quota plan

      00:00

      Default

      03:00

      Quota plan added in the previous step

      08:00

      Default

      For the Default quota plan, the number of elastically reserved CUs is 0.

    4. Click OK.

      Take note of the consumption of resources in quotas to perform routine O&M on job resources, and change the number of elastically reserved CUs based on business changes.

Scenario 2: Implement low-cost and high-guaranteed acceleration

Subscription reserved CUs of MaxCompute are allocated to level-2 quotas, and time-specific and priority-based settings are configured for the quotas. The CU usage remains high for a whole day. The customer expects to complete the output of specific data in advance to explore more data value.

The following figure shows the trend of the daily CU usage in this scenario. In this example, the customer purchases 750 subscription reserved CUs. The CU usage remains about 100% for a whole day and the average job execution duration is long. The output of an important piece of data was originally completed before 07:00. The customer requests to obtain the data output before 06:00. The original monthly fee is USD 16,500, which is calculated by using the following formula: 750 × 22.0.场景2

Elastically reserved CU solution: The resource request trend shows that more than 750 CUs are required during the period of 03:00-07:00. If you want to complete specific jobs before 06:00, you must scale out CUs during the period. You can use Information Schema to obtain the trend of CU usage of the jobs that are used to process the data. In the preceding figure, the CU usage remains about 100% during the period from 03:00 to 08:00. You can obtain the total number of CUs used during the period from 03:00 to 07:00. If the total number of CUs used during the four hours is 2,000, 500 CUs are used to run for the four hours. To complete the job execution before 06:00, you must prepare 667 CUs per hour, which is calculated by using the following formula: 2000/3. You can configure an additional 30% of CUs in consideration of unevenly distributed requests due to job dependencies. This means that a total of 867 CUs (667 × 1.3) are required. In summary, 367 (867 - 500) CUs need to be added from 03:00. You can increase the number of elastically reserved CUs at a step of 50 CUs. Therefore, you can purchase 350 elastically reserved CUs to run for 3 hours every day. The following figure shows the trend of CU usage.

Note

In this case, the number of elastically reserved CUs required is evaluated based on the average CU usage in ideal situations. In practical application, you can perform evaluation by using this method. However, you must take note of business changes and perform debugging based on actual situations.

场景二弹性

If you use subscription reserved CUs for computing acceleration in this example, the additional fee that you need to pay is USD 7,700 per month, which is calculated by using the following formula: 350 × 22.0. If you use elastically reserved CUs, the additional fee is USD 1,537.2 per month, which is calculated by using the following formula: 350 × 0.0488 × 3 × 30. The elastically reserved CU solution reduces the monthly fee by about 80%.

To configure elastically reserved CUs, perform the following steps:

Note

Before you perform the following steps, make sure that the time-specific configuration is not used or is used but reset.

  1. Log on to the MaxCompute console. In the top navigation bar, select a region.

  2. In the left-side navigation pane, choose Workspace > Quotas.

  3. Add a quota plan.

    1. On the Quotas page, find the quota that you want to manage and click Quota Configuration in the Actions column.

    2. On the Quota Configuration page, click the Quota Plans tab.

    3. On the Quota Plan tab, click Add Plan.

    4. In the Create Quota Plan dialog box, specify the plan name, and set the number of elastically reserved CUs to 350 for the level-1 quota.

    5. Allocate the number of elastically reserved CUs configured for the level-1 quota to the level-2 quota.

    6. Click OK.

  4. Configure a time plan.

    1. On the Quota Configuration page, click the Time Plans tab.

    2. On the Time Plans tab, click Edit Time Plan.

    3. In the Edit Time Plan dialog box, configure the items listed in the following table.

      Start time

      Quota plan

      00:00

      Default

      03:00

      Quota plan added in the previous step

      06:00

      Default

      For the Default quota plan, the number of elastically reserved CUs is 0.

    4. Click OK.

      Take note of the consumption of resources in quotas to perform routine O&M on job resources, and change the number of elastically reserved CUs based on business changes.