Standby Keep-Alive Actor avatar
Standby Keep-Alive Actor

Pricing

Pay per usage

Go to Apify Store
Standby Keep-Alive Actor

Standby Keep-Alive Actor

Developed by

Tobiáš Potoček

Tobiáš Potoček

Maintained by Community

Achieve almost 100% availability of your Standby Actor by periodically starting a new run of the Actor.

0.0 (0)

Pricing

Pay per usage

0

2

1

Last modified

4 days ago

Standby Keep-Alive Actor

This Actor allows you to achieve almost 100% availability of your Standby Actor by periodically starting a new run of the Actor.

Note: This is an experimental Actor. Use at your own risk.

How it works

Availability might be impacted by the two following mechanisms of the platform:

  • The platform shuts down all runs if there is no incoming traffic, causing the next incoming request to deal with the Actor cold start.
  • The platform needs to migrate runs between machines once in a while, during which the Standby run is not able to handle requests.

This Actor can automatically start new Standby runs at given interval, which will ensure that there always is an instance. By configuring the interval right (see below), you can actually achieve arbitrary concurency, which should overcome the migration problem. For example, if you have always 2 runs running, it's very unlikely that both will be migrated at the same time.

How to achieve desired concurrency

Run concurrency will be the result of the combination of intervalSecs and the idleTimeoutSecs setting of the target Standby Actor.

For example, if idleTimeoutSecs is 600 (a standby run will shut down after 10 minutes of inactivity), and you want to have always at least 3 concurrent runs, then you should set intervalSecs to roughly 200 (or rather less to be safe).

Note that the standard Standby scaling mechanism will still work in the background. It'll scale up to accommodate incoming traffic, and then scale down when the traffic drops, but never below the desired concurrency maintained by this Actor.

Input

  • standbyActorId (string, required) — ID or username/actor-name of the Standby Actor to run.
  • intervalSecs (number, default 60) — How often to start a new run (in seconds).
  • runInput (any, optional) — Input passed to the standby Actor.
  • build (string, optional) — Build tag/version for the standby Actor.
  • memoryMbytes (number, optional) — Memory override for the runs.