Function Compute provides pay-as-you-go instances and reserved instances. This topic describes the characteristics of the two types of instances. You can select an instance type as needed.

Pay-as-you-go instances

Pay-as-you-go instances are allocated and released by Function Compute. When Function Compute receives function invocation requests, it adds pay-as-you-go instances to handle the requests. After the requests are processed, Function Compute releases the instances. Pay-as-you-go instances are scalable and reliable. Pay-as-you-go instances help you simplify resource management work.

However, you cannot avoid cold start when you use pay-as-you-go instances, which affects your online applications if they are sensitive to the response latency.

Reserved instances

Reserved instances are allocated and released by users, and are billed based on their running durations.

A reserved instance is ready for use after it is created. This completely eliminates impacts caused by cold start.

By default, reserved instances are prioritized over pay-as-you-go instances. When Function Compute receives function invocation requests, it preferentially uses reserved instances to handle the requests. If the reserved instances are insufficient to handle all the requests, Function Compute adds pay-as-you-go instances as an addition, and sends the remaining requests to the pay-as-you-go instances.

A reserved instance is billed based on its running duration, which is measured from the time when the instance is started to the time when it is released. Therefore, even if a reserved instance that is not released does not process any requests, you must pay for it.On-Demand Resources
Note Before you call the Function Compute API to release a reserved instance, ensure that no new requests are sent to the instance.

For more information about pricing and billing, see billing methods.