Help Center> FunctionGraph> Billing> Billing Examples
Updated on 2023-11-06 GMT+08:00

Billing Examples

Billing Scenario I

A user created functions A, B, and C in April, as shown in Table 1. Assume that the total number of executions of these three functions in April was 2 million, 100,000, and 100,000. How much was the user billed for the three functions in April?

Table 1 Function details

Function

Description

Function A (not using reserved instances)

Created on April 5, 2023. Assume that the memory of function A is 512 MB and the execution duration is 0.5s.

Function B (using reserved instances and idle mode disabled)

Created on April 18, 2023. Assume that the memory of function B is 128 MB and the execution time is 10s. If function B was deleted on April 30, 2023, the running duration of function B is 12 days.

Function C (using reserved instances and idle mode enabled)

Created on April 20, 2023. Assume that the memory of function C is 128 MB and the execution time is 5s. If function C was deleted on April 30, 2023, the running duration of function C is 10 days.

Billing Analysis (Scenario I)

Functions A, B, and C are billed separately since they use different types of instances. For details, see Table 2.

Table 2 Billing details

Billing Item

Billing Details

Price for requests

(2 million requests + 100,000 requests + 100,000 requests – 1 million requests) x $0.2 USD/1 million requests = $0.24 USD

Price for execution duration

Total execution duration of function A: 512 MB/1024 MB x 1s x 2 million requests = 1 million GB-seconds.

Total execution duration of function B: 128 MB/1024 MB x (12 x 24 x 60 x 60) = 129,600 GB-seconds.

The execution duration of function C is divided into two parts:

  • Execution duration: 128 MB/1024 MB x 5s x 100,000 requests = 62,500 GB-seconds
  • Idle duration: 128 MB/1024 MB x (10 x 24 x 60 x 60 – 5s x 100,000 requests) = 45,500 GB-seconds

Price for execution duration of functions A, B, and C: $0.00001667 USD/GB-second x (1 million GB-seconds + 129,600 GB-seconds + 62,500 GB-seconds – 400,000 GB-seconds) + 45, 500 GB-seconds x $0.000005556 USD/GB-second = $13.457105 USD

Total

Price for requests + Price for execution duration = $0.24 USD + $13.457105 USD = $13.697105 USD ≈ $13.70 USD