Skip to content

Keep a function ready with dedicated replicas

View as Markdown

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.

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.

  1. In Compute > Functions, click the function’s name to open its page, and open the System Configuration tab.
  2. Turn on Enable Dedicated Replica.
  3. Set Minimum Replica to the number of instances to keep running, from 1 to 5. Start with 1.
  4. Click Save.

You can also set dedicated replicas when you create the function. See Create a function.

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.

  1. On the function’s page, open the System Configuration tab.
  2. Turn off the dedicated replica checkbox beside Minimum Replica. The checkbox reads Enable Dedicated Replica again.
  3. Click Save.

The function redeploys without dedicated replicas, and Dedicated Replicas on the Info tab shows 0.

The function keeps the number of instances you set ready for requests. To change the count later, see Edit a function.