Scheduler Service

The scheduler service is an environment service that orchestrates requests for function containers.

The scheduler service is capabale of automatically handling inbound requests for function containers linked to a DNS Record via the native load balancer.

There is also a dedicated API , when more control over the execution of function containers is desired.

How the Scheduler Service Works

The scheduler service is designed for rapid initialization of function containers, even when under significant load. The scheduler doesn't rely on communication with Cycle's core, thus operating in a decentralized manner for optimal throughput.

The scheduler works off a sharding algorithm. As new instances of the scheduler are added into the pool, the instances comes to a consensus on which set of function container instances each is responsible for.

High Availability

Instead of a platform-managed high availability setting, the scheduler achieves high availability via manual scaling.

Caution

If the scheduler is routing requests to function containers via the load balancer, the load balancer must be restarted when new scheduler instances are added.

Initializing Functions via URL

When connecting function containers to a LINKED record, the scheduler service acts as an invisible coordinator, automatically receiving the requests from the load balancer and managing the lifecycle of the function container behind the scenes. No further configuration is required for this to work. This would allow for a job to be executed, a website to be served, or some processing to happen simply by hitting the URL assigned to the LINKED Record.

The Scheduler API

The scheduler comes with a dedicated API for more manual control over when jobs are executed, or for integration into other applications. The scheduler can be reached over the environment's private network via http://env-scheduler. The API is documented with an OpenAPI spec, so it is possible to generate a client in most languages. The Cycle team also maintains a NodeJS client.

Access Keys

An access key must be created when utilizing the scheduler via the scheduler API . The access key will be added as a header to every API request, and can be restricted to specific IPs.

Learn How to Create Scheduler Access Keys

Publically Exposing the Scheduler

Not Required For Functions

This is not necessary to access function containers directly via a LINKED record.

The scheduler can be configured to be publicly exposed, enabling it to be connected directly to its own LINKED Record.

The advantage of doing this is that the scheduler API can be exposed to a third party service for testing, CI/CD, or other custom batch processing logic.