Help Center> FunctionGraph> Billing> Billing Items
Updated on 2023-10-12 GMT+08:00

Billing Items

Billing Description

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

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

This billing item consists of two variables: execution duration and memory allocated to the function. FunctionGraph provides reserved and on-demand instances, which use compute resources differently.

Pay-per-use

-

(1) If no reserved instances are used, the total compute resource consumption is the product of memory configured for a function and the execution duration. The execution duration is from the time your function code starts to execute to the time when it returns a response or terminates, and is rounded up to the nearest 1s. A duration of less than 1s is calculated as 1s.

Compute resource consumption = Memory size (GB) x 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) x Unit price per GB-second

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

(2) If reserved instances are used, 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.

  1. If the idle mode is disabled, the compute resources consumption of a function is calculated as follows: Memory size (GB) x 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) x Unit price per GB-second
  2. If the idle mode is enabled, the compute resources consumption of a function is calculated as follows: Memory size (GB) x [Running duration of reserved instances – Execution duration of reserved instances (s)] + Memory size (GB) x Execution duration of reserved instances (s).
    • The first 400,000 GB-seconds are free of charge.
    • Billing beyond the free quota is calculated as follows: Memory size of the function (GB) x (Running duration of reserved instances – Execution duration of reserved instances) x Unit price per GB-second in idle mode + [Memory size of the function (GB) x (Execution duration of reserved instances – 400,000 GB-seconds)] x Unit price per GB-second during execution.

The execution duration in the idle mode is not included in the 400,000 GB-second free quota. 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.