This topic describes features related to reserved instances.
Instance types
Based on the instance usage mode, function instances fall into two types: elastic instances and reserved instances.
- Event functions, web applications, and tasks
- Microservices applications
- Microservices applications also support both reserved instances and elastic instances. Reserved instances are always running, while elastic instances are created on demand. Their differences are as follows:
- The number of reserved instances for a microservices application must be at least 1, which means at least one instance must always be running.
- Users define the autoscaling policy for microservices apps, and veFaaS scales instances based on the user-defined policy.
- For microservices applications, both reserved and elastic instances are billed at the reserved instance price.
Configure static reserved instances
Configuring static reserved instances effectively prevents request latency caused by cold starts of elastic instances during peaks of function invocation.
tip
When you configure static reserved instances for the first time, go to Release > Minimum instances.
- In the top navigation bar, select the region where your business is located.
- In the function list, find the target function and click its name to go to its details page.
- Click the Resource management tab. In the Maximum resources section, edit Instance count range to modify the minimum number of instances.
- veFaaS will maintain at least this number of continuously running instances until the application stops.
Configure the scheduled scaling policy for instance numbers
When your function exhibits clear periodic patterns or predictable traffic spikes, you can configure scheduled policies based on business characteristics to dynamically scale instances. This improves instance utilization and reduces resource waste.
- In the top navigation bar, select the region where your business is located.
- In the function list, find the target function and click its name to go to its details page.
- Click the Resource management tab. Click Create in the Scheduled policy section.
- In the pop-up panel, click Add scheduled policy to configure a scheduled scaling policy.
- You can add multiple scheduled policies. Each function can have up to 10 policies.
- Check the policy effective time and the preview chart of reserved instance count, and then click Save.
- (Optional) View the effective status of the scheduled scaling policy.
- After configuration, the scheduled policy is enabled by default. You can edit, delete, and disable it subsequently.
- When the scheduled policy takes effect, instances are scaled based on the policy, and the generated reserved instances have a reserved identifier. For more information, see Resource function statistics.
View the number of reserved instances
You can view the number of reserved instances for all functions in the current region on the Resource allocation page.
- In the top navigation bar, select the region where your business is located.
- In the left navigation pane, click Function > Resource allocation.
- In the Allocation details section, view the value in the Instance count range column for the target function. The minimum value of the range is the current number of reserved instances.
Increase the memory quota for reserved instances
If your function has insufficient memory, you can increase the memory by adding more instances on the Resource management page of the function.
- In the top navigation bar, select the region where your business is located.
- In the function list, find the target function and click its name to go to its details page.
- Click the Resource management tab. Edit Instance count range to modify the maximum number of instances in the Maximum resource section.
- (Optional) If the number of instances to be added exceeds the Maximum instances displayed on the page, apply for more quota in the Quota Center.
- Select AccountResource for Quota parameter, and select the region where the instance is located.
- Click Apply in the Actions column.
- Enter the quota limit for the target instance and the reason for the application.
- Click Submit to apply for the quota.