The billing of SCF contains the following four parts. The fees are accurate to two decimal places in USD for Tencent Cloud International.
The basic fees of SCF are billed based on the actual usage.
Billable Item | Description |
---|---|
Resource usage fee | Resource usage is calculated in GBs by multiplying the configured function memory size by the function execution duration. |
Invocation fee | Each function triggering and execution is calculated as an invocation. HTTP-triggered functions are billed by the number of invocations in the same way. |
Public network outbound traffic fee | The outbound traffic consumed when the function code accesses the public network is counted as the public network outbound traffic in GB. |
Idle provisioned concurrency fee | The number of idle instances is calculated by subtracting the number of actually running concurrent instances from the number of launched provisioned instances, and the idle resource usage is calculated in GBs by multiplying the number of idle instances by the configured memory size. |
Basic package fee | A basic package tier is automatically granted, and the fee is automatically deducted on a monthly basis (0.06 USD/day). This fee will be charged in the following cases: 1) You are a three-month new user. 2) You have valid subscription packages. 3) No resource usage, function invocation, and outbound traffic were incurred in the last month. |
HTTP-triggered function response traffic fee | It is counted only for HTTP-triggered functions configured with default triggers. For more information, see HTTP-Triggered Function Billing. |
For the unit price of each billable item, see Product Pricing.
Note:For HTTP-triggered functions using the default trigger, HTTP-triggered function response traffic will be additionally generated, which is not included in the free tier. For more information, see HTTP-Triggered Function Billing.
After a subscription package is purchased, it can be used to deduct the above pay-as-you-go billable items.
Billable Item | Description |
---|---|
Subscription package | It is purchased in the form of monthly subscription and can be used to deduct the fees of function resource usage, function invocation, public network outbound traffic, function concurrency quota, and function burst in the specified region/namespace. The resources in the subscription package will be deducted based on the expiration time. If the actual usage is less than or equal to the package quota, no additional function execution fees will be incurred. Excessive usage will be automatically billed in a pay-as-you-go manner. |
Other paid products may be used when you use the SCF service as listed below:
Billable Item of Associated Service | Description |
---|---|
CLS fee | The log query function of SCF is provided by CLS. Operation logs are shipped to CLS by default. For more details, see Log Shipping Configuration. Starting September 5, 2022, CLS offers a limited free tier to new users within three months of activation, after which they will be charged a volume-based log service fee. See Log Service Pricing. |
API Gateway, COS, CKafka, and other fees | 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. |
Resource usage fees = (resource usage - free tier) * resource usage unit price
Resource usage = memory configured for function * execution duration
Memory configured for the function is calculated in GB, and charged duration is calculated in seconds (converted from milliseconds). So resource usage is calculated in GBs (GB-second).
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.
Resources used in each run are calculated on an hourly basis.
Note:
- SCF resource usage is calculated by multiplying the configured function memory size by the actually triggered execution duration of the 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, see Billing Example.
- Due to issues such as the uncertainty of computing resources where SCF runs, specific actions in the 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 = (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 invocation.
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:
Idle provisioned concurrency fees = number of idle instances * configured memory size * idle duration * idle provisioned concurrency unit price
Note:Idle provisioned concurrency is calculated in GBs (GB-second).
The provisioned concurrency feature only charges small idle fees for the instances that have been configured and started but are not in use, while no additional fees are charged for the instances that have been configured and are in use. In other words, only when the number of provisioned instances is greater than the number of concurrent instances for the current version will idle fees be incurred. For examples, see Billing Example.
Note:
- If you have used SCF for three months or shorter after the activation, the platform will grant a free tier by default without deducting the basic package fees.
- If you have used SCF for more than three months after the activation, and you have valid subscription packages, the basic package fees will not be charged.
- The function invocations in a calendar month is counted on the first day of the next month. If there is no any function-related usage incurred, including the function resource usage, function invocations, and public network outbound traffic, the basic package fees will not be charged in the current month. If any function usage is generated in the current month, the basic package fees will be charged next month.
Was this page helpful?