Help Center/ FunctionGraph/ Billing/ Billing Items
Updated on 2024-09-09 GMT+08:00

Billing Items

Billing Description

The billing items of FunctionGraph consist of requests, execution duration, and others. For details, see Table 1.

For details about FunctionGraph prices, see FunctionGraph Pricing Details.

Table 1 FunctionGraph billing items

Billing Item

Description

Billing Mode

Formula

Requests

Total number of times all of your functions are invoked.

Pay-per-use

  • The first 1,000,000 requests every month are free of charge.
  • Billing beyond the free quota = (Total number of requests – 1,000,000) x Unit price per 1,000,000 requests

For details about the unit price of requests, see Pricing Details.

Execution duration (non-reserved instances)

The execution duration fee depends on the execution duration and memory allocated to the function. The following describes how computing resources are calculated:

FunctionGraph calculates the resource consumption of a function by multiplying the selected memory by the execution duration. The execution duration is calculated from the time when your function code starts to execute to the time when it returns a response or terminates. It is rounded up to the nearest 1 ms. If the duration is less than 1 ms, you will be billed for 1 ms. For example, if function A is executed for 0.5 ms and function B is executed for 2.3 ms, the execution duration of function A is 1 ms and that of function B is 3 ms.

Pay-per-use

Compute resource consumption = Memory size (GB) × Execution duration (s)

  • The first 400,000 GB-seconds are free of charge.
  • Billing beyond the free quota = (Total compute resources consumed by all functions – 400,000 GB-seconds) × Unit price per GB-second

For details about the unit price of execution duration, see Pricing Details.

NOTE:

Before calculating the resource consumption of a function, convert milliseconds to seconds.

Execution duration (reserved instances)

The execution duration fee depends on the execution duration and memory allocated to the function. The following describes how computing resources are calculated:

FunctionGraph starts billing when a reserved instance is created. If a reserved instance stays alive for less than 1 minute, you will be billed for 1 minute. Otherwise, you will be billed based on the actual duration, and the part beyond 1 minute will be rounded up to the nearest 1s. For details, see Reserved Instance Billing and Billing Analysis (Scenario I).

Pay-per-use

  • Idle mode disabled
    The compute resources consumption of a function is calculated as follows: Memory size (GB) × Reserved instances' running duration (s).
    • The first 400,000 GB-seconds are free of charge.
    • Billing beyond the free quota = (Total compute resources consumed by all functions – 400,000 GB-seconds) × Unit price per GB-second
  • Idle mode enabled
    The compute resources consumption of a function is calculated as follows: Idle resource consumption + Execution resource consumption.
    • The idle resource consumption (not included in the 400,000 GB-second free quota) is calculated as follows:

      Memory size (GB) × [Running duration of reserved instances – Execution duration of reserved instances (s)] × Unit price per GB-second in idle mode

    • The execution resource consumption (included in the 400,000 GB-second free quota) is calculated as follows:

      The first 400,000 GB-seconds are free of charge.

      Billing beyond the free quota is as follows: [Memory size of the function (GB) × Execution duration of reserved instances –- 400,000 GB-second] × Unit price per GB-second in idle mode.

For details about the unit price of execution duration, see Pricing Details.

Others

Additional charges will apply if other cloud services, such as OBS and SMN, are used with FunctionGraph.

Billing modes of involved services

The billing modes of other cloud services are different. For details, see Pricing Details.

Reserved Instance Billing

You can create and release reserved instances and will be billed based on their execution duration. Reserved instances stay alive in the execution environment, eliminating the influence of cold starts on latency.

  • If you call an API to create a reserved instance, billing will begin as soon as the reserved instance creation is complete.
  • If you call another API to release a reserved instance, new requests will not be routed to the reserved instance. The reserved instance will be released within a certain period, and the billing will stop.
    Figure 1 Lifecycle of a reserved instance

    As shown in Figure 1, the billing lasts from T1 to T4.

    Reserved instances are metered at a granularity of second. If a reserved instance runs for any fraction of a minute, you will be billed for the full minute. Otherwise, you will be billed based on the actual execution duration.

    For example, if a reserved instance runs for 51s, you will be billed for 1 minute. If the reserved instance runs for 61s, you will be billed for 61s.

  • The unit of execution duration is GB-second, which means that when the memory size is 1 GB, the duration is charged by the second.