Updated on 2023-12-07 GMT+08:00

Queues

Billing Modes

Queues provide compute resources for DLI jobs. Queues support the following billing modes:

  • Pay-per-use: Pay-per-use is a postpaid mode. You can use this mode to purchase queues, including pay-per-use dedicated resources and pay-per-use non-dedicated resources.
    • Pay-per-use dedicated resources: If you select Dedicated Resource Mode for Type when buying a queue, a dedicated queue will be created that operates on a pay-per-use basis. The queue resources will remain allocated for the duration of its use. You will be billed by calendar hour since the queue is created.
    • Pay-per-use non-dedicated resources: If you do not select Dedicated Resource Mode, a non-dedicated queue will be created that is billed on a pay-per-use basis. You will only be billed for running jobs on the queue, and the billing will be based on the actual CUs used by the queue.

    Pay-per-use computing fee = Unit price x Actual number of CUs x Number of hours. Usage is billed by the hour, with any usage less than one hour being rounded up to one hour. The number of hours is calculated on the hour.

  • Yearly/Monthly: You are advised to combine yearly/monthly with pay-per-use when purchasing queue CUs. If you have purchased a yearly/monthly package for queue CUs, the package quota will be used first during your resource usage, and any usage beyond the quota will be billed on a pay-per-use basis. The quota included in a monthly/yearly package will reset based on the subscription period. See Yearly/Monthly Billing for more information.
  • Scanned data volume: Only the default queue supports billing by the scanned data volume. Refer to Billing for Scanned Data for details about this billing mode.

This section describes the billing rules of pay-per-use DLI queues.

Application Scenarios

  • Pay-per-use: This billing mode applies to test projects that do not require significant resources and are infrequently used. This mode is cost-effective and does not require any prepayment.
  • Yearly/Monthly: This billing mode is suitable when resource needs for a service vary over time. For example, during a certain period, you may require more compute resources to handle your workloads, but after that period, you may not need as many resources. If you purchase a small queue, you may experience resource shortages during busy periods, while purchasing a larger queue may result in resource waste.

    To address these issues, you can create elastic scaling scheduled tasks based on your service periods or usage using the queue elastic scaling feature.

    For detailed instructions, refer to Scheduling CU Changes.

Constraints and Limitations

  • Pay-per-use non-dedicated queues are only billed when there are active jobs running on them.
  • Pay-per-use dedicated queues are billed by calendar hour since they are created.
  • Usage is billed by the hour, with any usage less than one hour being rounded up to one hour. The number of hours is calculated on the hour.
  • Pay-per-use queues are billed based on the number of CUs purchased, rather than the CUs utilized to execute jobs.
  • You can combine pay-per-use billing with CUH packages. Your resource usage will first be deducted from the quota included in your CUH package, and any additional usage beyond the package limit will be billed on a pay-per-use basis. The quota included in the CUH package for a queue will reset every month.
  • DLI does not support billing mode change.

Billing Rules

Billing rules for queues vary depending on the billing mode.

Table 1 Billing rules for queues

Billing Mode

Resource

Description

Pay-per-use

Queue

Computing fee = Unit price x Number of CUs x Number of hours

When you buy a queue, you can view the fee details at the bottom of the purchase page.

Pay-per-use configuration fee: The fee is calculated based on the selected configuration, including the queue type and size.

Billing Usage Period

Pay-per-use DLI queues are billed by the hour, with any usage less than one hour being rounded up to one hour. The number of hours is calculated on the hour (UTC+08:00). After the billing is complete, a new billing cycle starts.

The start time for billing differs depending on whether the queue is dedicated or not.

  • Pay-per-use dedicated queue: A pay-per-use dedicated queue is billed by the calendar hour since it is created, and the billing ends since the queue is deleted.
  • Pay-per-use non-dedicated queue: A pay-per-use non-dedicated queue is only billed when there is any active job running on it, and the billing ends since the job is complete and the queue becomes idle. (An idle queue indicates that there is no active job running the queue.)

Creating a queue takes some time. For a pay-per-use dedicated queue, billing starts once it is successfully created, not when the creation process begins. You can check whether the queue is started by running SELECT statements.

Example:

  • If you purchased a pay-per-use dedicated queue at 08:45:30 and deleted it at 08:55:00, you will be billed for one hour. The billing cycle runs from 08:00:00 to 09:00:00, with any usage less than one hour being rounded up to one hour.
  • If you purchased a pay-per-use non-dedicated queue at 08:45:30, started a job on it at 09:05:00, finished the job at 09:55:00, and deleted the queue at 10:05:00, you will be billed for one hour. The billing cycle runs from 09:00:00 to 10:00:00, and any usage less than one hour is rounded up to one hour.

Billing Examples

The prices are just examples. The actual prices are those displayed on DLI Pricing Details.

  • Example 1: Pay-per-use dedicated queue
    Assume that you purchased a pay-per-use dedicated queue (type: For SQL; specifications: 16 CUs; single-AZ deployment) at 09:59:30 on April 18, 2023 and then deleted it at 10:45:46 on April 18, 2023.
    • The first billing cycle runs from 09:00:00 to 10:00:00, with any usage less than one hour being rounded up to one hour. In this billing cycle, the billing duration is one hour.
    • The second billing cycle runs from 10:00:00 to 11:00:00, with any usage less than one hour being rounded up to one hour. In this billing cycle, the billing duration is also one hour.

    You need to pay for both billing cycles. Table 2 lists the billing formula. The hourly price of the resource is displayed in the product pricing details.

    Table 2 Billing formula

    Resource Type

    Billing Formula

    Unit Price

    Compute resource

    Computing fee = Unit price x Number of CUs x Number of hours

    For details, see DLI Pricing Details.

    The following is an example of calculating the fee of a pay-per-use queue:

    Queue unit price: 0.057 USD/hour; actual CUs: 16 CUs; accumulated billing duration: 2 hours

    Total fee: 1.82 USD

  • Example 2: Pay-per-use non-dedicated queue
    Assume that you purchased a pay-per-use non-dedicated queue (type: For SQL; specifications: 16 CUs; single-AZ deployment) at 09:59:30 on April 18, 2023, run a job on it at 10:05:00, finished the job at 11:15:00, and deleted it at 11:45:46 on April 18, 2023.
    • The first billing cycle runs from 10:05:00 to 11:00:00, with any usage less than one hour being rounded up to one hour. In this billing cycle, the billing duration is one hour.
    • The second billing cycle runs from 11:00:00 to 11:15:00, with any usage less than one hour being rounded up to one hour. In this billing cycle, the billing duration is also one hour.

    You need to pay for both billing cycles. Table 3 lists the billing formula. The hourly price of the resource is displayed in the product pricing details.

    Table 3 Billing formula

    Resource Type

    Billing Formula

    Unit Price

    Compute resource

    Computing fee = Unit price x Number of CUs x Number of hours

    For details, see DLI Pricing Details.

    The following is an example of calculating the fee of a pay-per-use queue:

    Queue unit price: 0.057 USD/hour; queue specifications: 16 CUs; accumulated billing duration: 2 hours

    Total fee: 1.824 USD

Impact of Arrears

Figure 1 shows the statuses a pay-per-use DLI queue can have throughout its lifecycle. Once you purchase a DLI queue, it will be considered valid during the billing cycle as long as it operates normally. However, if your account exceeds the expenditure quota, the queue will gradually enter the grace period and retention period.

Figure 1 Lifecycle of a pay-per-use DLI resource

Arrears Reminder

The system deducts fees from your account balance for pay-per-use resources at the end of each billing cycle. You will be notified by email, SMS, or internal messages when your account exceeds the expenditure quota.

Impact of Arrears

Your resources enter the grace period and you cannot submit jobs in DLI, including SQL, Spark, and Flink jobs. You will need to pay for the fees incurred during the grace period, which you can see on the Billing & Costs > Billing Center > Overview page of the Huawei Cloud console.

If you do not bring your account balance current before the grace period expires, your resources will enter the retention period and become frozen. You cannot perform any operations on the pay-per-use resources during this period.

If you do not bring your account balance current before the retention period ends, your resource will be released and the data cannot be restored.

For details about expenditure quotas, see Expenditure Quota.

Combination of Pay-per-Use and Yearly/Monthly

DLI allows you to use yearly/monthly and pay-per-use together.

If you purchase a CUH package for a queue, your resource usage will first be deducted from the included quota, and any additional usage beyond the package limit will be billed on a pay-per-use basis. The quota included in the CUH package for a queue will reset every month.

For details about how to use a package, see Yearly/Monthly Billing.