Turn on Enable Dedicated Replica to keep a set number of instances of a function always running. A request then reaches an instance that is already up. Without replicas, a request can wait for an instance to start. That wait is a cold start.
Dedicated replicas add nothing to the bill. A replica waiting for requests is not charged. See Billing.
Before you begin
Section titled “Before you begin”Dedicated replicas are available for CPU and container functions. See Runtimes and hardware.
You can change dedicated replicas while the function is Running or Failed.
Turn on dedicated replicas
Section titled “Turn on dedicated replicas”- In Compute > Functions, click the function’s name to open its page, and open the System Configuration tab.
- Turn on Enable Dedicated Replica.
- Set Minimum Replica to the number of instances to keep running, from 1 to 5. Start with 1.
- Click Save.
You can also set dedicated replicas when you create the function. See Create a function.
Check that the change applied
Section titled “Check that the change applied”After you save, the function redeploys. Select the function in the Functions list and open the Info tab below the list. The Info tab shows Dedicated Replicas, with the count you set.
Turn off dedicated replicas
Section titled “Turn off dedicated replicas”- On the function’s page, open the System Configuration tab.
- Turn off the dedicated replica checkbox beside Minimum Replica. The checkbox reads Enable Dedicated Replica again.
- Click Save.
The function redeploys without dedicated replicas, and Dedicated Replicas on the Info tab shows 0.
What you have now
Section titled “What you have now”The function keeps the number of instances you set ready for requests. To change the count later, see Edit a function.