Billing Mode

Last updated: 2020-04-01 17:29:10

    Billing Mode

    For more information on SCF billing, please see Billing Mode, Product Pricing, and Notes on Arrears.

    SCF is pay-per-use service without upfront payment. Fees are calculated per hour in USD. An SCF bill consists of the following three parts (each part is billed according to its statistics and calculation method, and the fees are accurate to 2 decimal places in USD).

    • Resource usage fees
    • Invocation volume fees
    • Public network outbound traffic fees

    For the unit prices of resource usage, invocation volume, and public network outbound traffic, please see Product Pricing. Here, the public network outbound traffic is in GB.

    Billing Principles

    SCF fees will be incurred by actual loading and execution of function code. If the function code is not actually executed, no fees will be incurred. Below is an example:

    Scenario Function Execution Status Calculated Billed
    A request error occurs due to an incorrect parameter, incorrect function name, or non-existent function. Not executed No No
    An error occurs due to function execution timeout or function execution memory overrun. Executed Yes Yes
    An error occurs due to a function code problem. Executed Yes Yes
    A request error occurs due to concurrence overrun. Not executed No No

    Resource Usage Fees

    Resource usage fees = (resource usage - free tier) * resource usage unit price

    Resource usage in GBs

    Resource usage = memory configured for function * execution duration

    Resource usage is calculated by multiplying the memory configured for function by the billable function execution duration. Here, the configured memory is in GB, and the billable duration is converted from milliseconds to seconds. Therefore, the resource usage is in GBs.

    For example, if a function with 256 MB memory configured is executed for 1760 ms, then the billable duration is 1760 ms, and the resource usage of this function execution will be (256/1024) * (1760/1000) = 0.44 GBs.

    Resource usage will be calculated for each function execution and aggregated in each hour as the hourly resource usage.

    • Currently, SCF resource usage is calculated by multiplying the memory configured for function by the actually triggered execution duration of function. Compared with the billing method of 100-ms upward aggregation, this billing method calculates lower overall resource usage and incurs fewer fees. For more information, please see Billing Sample.
    • Due to issues such as uncertainty of computing resources where SCF runs, specific actions in code, and relevant network communications, the execution duration of the same function code may vary slightly when the code is triggered at different times.

    Invocation volume fees

    Invocation volume fees = (number of function invocations - free tier) * invocation unit price

    Each function triggering and execution will be calculated as an invocation and aggregated in each hour as the hourly invocation volume. Fees will be charged per 10,000 invocations.

    Public Network Outbound Traffic Fees

    Public network outbound traffic fees = public outbound traffic * traffic unit price

    Outbound traffic will be generated when resources are accessed over the public network in a function, such as uploading a file to an external storage space:

    • When the code writes files to the storage space provided on the public network, outbound traffic will be generated by sending files; when the code reads data or files from the storage space provided on the public network, outbound traffic will be generated only by sending requests but not by reading or downloading files.
    • If a function is configured with a VPC and writes data to a database in the VPC in its code, no outbound traffic will be generated by data writes.
    • For a function that uses an API Gateway trigger, no function outbound traffic will be generated by the data returned after the function is executed; the traffic generated by the data returned by API Gateway to the client will be calculated as the outbound traffic of and billed by API Gateway.

    Fees of Other Products

    If you use other products such as CMQ, CKafka, API Gateway, and COS when using SCF, fees will be calculated according to the billing rules of the actually used products.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help