---
title: "High Availability in Kestra: Scale Workers and Webservers"
description: Design and configure Kestra for High Availability (HA) to ensure fault tolerance and continuous operation in production.
url: https://kestra.io/docs/administrator-guide/high-availability
---

# Design and configure a fault-tolerant highly available cluster

High availability in Kestra is achieved by running each server role as its own independently scaled process in a distributed deployment. If one instance fails, the cluster continues operating: other instances pick up the work and the liveness model releases any orphaned jobs back onto the queue.

High availability does not require a specific queue backend. Any distributed deployment (database queue, AMQP/Redis, or Kafka) is eligible. The choice of backend affects throughput and latency, not fault tolerance. See [Deployment Architecture](https://kestra.io/docs/architecture/deployment-architecture) for guidance on choosing a backend.

## Distributed deployment

In a distributed deployment, each server role runs as its own process and scales independently:

- **Executor**: owns the execution state machine; decides which task runs next and joins results
- **Scheduler**: watches schedules and event triggers, emits executions onto the queue
- **Worker Controller**: brokers worker availability, routes jobs to worker pools via gRPC
- **Worker**: runs task code in an isolated working directory; scales horizontally
- **Webserver**: the only network-facing surface; hosts the REST API and UI
- **Indexer**: records execution data (except the execution itself) that is sent asynchronously (logs, metrics, statistics, ...)

Workers connect to the Worker Controller over a single outbound gRPC stream. They never access the queue or the database directly. This means workers can run in an isolated network, a different region, or behind a firewall that allows only outbound connections, and still participate in the cluster.

Each role runs as a dedicated process via its server command:

```bash
kestra server executor
kestra server scheduler
kestra server controller
kestra server worker
kestra server webserver
kestra server indexer
```

## Scaling components

Each role scales independently, either through its number of replicas in the Helm chart or with an autoscaler. See the [Kubernetes deployment guide](https://kestra.io/docs/installation/kubernetes) for a full setup walkthrough and the [chart values reference](https://github.com/kestra-io/kestra/blob/develop/charts/kestra/values.yaml) for all available options.

Workers are the primary horizontal scaling target. Additional replicas increase task throughput; the Worker Controller routes jobs across all connected workers automatically.

The Executor and Scheduler are coordinating roles; two or three replicas provide redundancy. Both are idempotent: if one fails, queue messages are redelivered and picked up by a healthy instance automatically.

Scheduler replicas share trigger evaluation by splitting flows across virtual nodes (16 by default, set with `kestra.scheduler.vnodes`). The Executor's liveness check assigns those virtual nodes to the running Schedulers and reassigns them when a Scheduler joins or leaves, so schedules only run while at least one Executor is running.

At least two Webserver replicas behind a load balancer keep the API and UI available if one instance fails.

### Autoscale components

The Helm chart can create a HorizontalPodAutoscaler (HPA) for a component. Set `autoscaler` under `common` to autoscale every component, or under one component in `deployments`. A component's `autoscaler` block replaces the one under `common` instead of merging with it, so set `minReplicas`, `maxReplicas`, and `metrics` in each block:

```yaml
deployments:
  worker:
    enabled: true
    resources:
      requests:
        cpu: "1"
    autoscaler:
      enabled: true
      minReplicas: 2
      maxReplicas: 10
      metrics:
        - type: Resource
          resource:
            name: cpu
            target:
              type: Utilization
              averageUtilization: 70
```

A CPU utilization target needs a CPU request on the pods, which the chart doesn't set by default. Without `metrics`, the HPA targets 80% CPU utilization.

When a component is autoscaled, the chart doesn't set its replica count and ignores its `replicas` value. The HPA alone owns the count, so `helm upgrade` leaves it in place.

To scale a component with KEDA or an HPA you create yourself, set `autoscaler.external` on that component. The chart then leaves the replica count to your autoscaler and doesn't create an HPA:

```yaml
deployments:
  worker:
    enabled: true
    autoscaler:
      external: true
```

Point your autoscaler at the component's Deployment, named `<fullname>-<component>`, such as `kestra-worker` for a release named `kestra`. Set `external` per component rather than under `common`: under `common`, the chart stops setting the replica count of every component, including the ones no autoscaler scales.

The upgrade that turns on `autoscaler` or `autoscaler.external` for a running component can drop it to one pod before the autoscaler scales it back up. This happens with Helm 3. Helm 4 keeps the current count when it applies the change server-side, its default for releases it installs.

Worker groups (Enterprise Edition) accept the same `autoscaler` block under `workerGroups.<name>`, and their Deployments are named `<fullname>-workergroup-<name>`. Autoscale either the `worker` Deployment or the worker groups, not both, because the `worker` Deployment's pod selector also matches every worker group pod. See [Helm worker group selector](https://kestra.io/docs/migration-guide/v2.1.0/helm-worker-group-selector).

:::alert{type="info"}
Ensure the underlying host system is tuned for high availability. For example, adjusting the Linux kernel parameter `net.ipv4.tcp_retries2` can reduce [TCP retransmission times](https://access.redhat.com/solutions/726753).
:::

## Liveness and fault tolerance

Every running server registers itself with the cluster and emits a heartbeat on a fixed interval (default: every 3 seconds). The Executor reviews all registered instances on a scheduled tick (default: every 10 seconds). See [Server lifecycle](https://kestra.io/docs/administrator-guide/server-lifecycle) for the full state machine and recovery behavior.

When a Worker misses its heartbeats beyond the configured timeout (default: 1 minute), the Executor marks it as failed. Whether its in-flight jobs go back onto the queue for a healthy Worker depends on that Worker's [`worker-task-restart-strategy`](https://kestra.io/docs/configuration/security-and-secrets#liveness-and-worker-task-restarts): with `NEVER`, they are not re-dispatched. For other server roles (Executor, Scheduler, Webserver), recovery works differently: these components are idempotent, so queue messages are redelivered and reprocessed by a healthy instance without explicit orphan recovery.

To tune the liveness model:

```yaml
kestra:
  server:
    liveness:
      enabled: true
      interval: 10s
      timeout: 1m
      heartbeat-interval: 3s
```

## Shared internal storage

In a distributed deployment, all server roles must have access to the same internal storage backend. Local filesystem storage is not suitable; all distributed deployments require a shared object store:

- [Google Cloud Storage](https://kestra.io/docs/installation/gcp-vm)
- [AWS S3](https://kestra.io/docs/installation/aws-ec2)
- [Azure Blob Storage](https://kestra.io/docs/installation/azure-vm)

Without shared storage, task outputs written by a Worker on one host are not reachable by the Executor or Webserver on another.

For a full list of supported backends (including Cloudflare R2, Huawei OBS, Ceph, and others), see [Internal Storage](https://kestra.io/docs/architecture/data-components).

## Load balancing

Put a load balancer in front of the Webserver replicas: the Webserver is the only role that serves API and UI traffic. Workers connect to the Worker Controller's gRPC port (`50051` by default), so that port must be reachable from wherever Workers run. Webserver and standalone servers start an embedded Worker Controller unless you pass `--no-controller`.

Point load balancer health checks at the Webserver's [`/health` endpoint](https://kestra.io/docs/administrator-guide/monitoring#kestra-endpoints) on the management port (`8081`), or at the unauthenticated `/ping` endpoint on the application port (`8080`).

## Queue backend and scale

All queue backends support high availability in a distributed deployment. Choose based on throughput and latency requirements:

- **Database** (PostgreSQL or MySQL): simplest option; covers most production use cases. Deploy PostgreSQL in HA mode (PGPool or a managed cloud service) so the database itself does not become a single point of failure.
- **AMQP / Redis**: lower queue latency than a database queue; also raises the throughput ceiling
- **Kafka**: highest throughput; each server role scales independently

For Kafka deployments, PostgreSQL is the recommended repository pairing. Elasticsearch can serve as the repository for the highest search and aggregation throughput.

See [Deployment Architecture](https://kestra.io/docs/architecture/deployment-architecture) for a full comparison.