> ## Documentation Index
> Fetch the complete documentation index at: https://docs.techulus.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Scaling

> Replicas, placement, and server pinning.

## Replicas

Each service can run multiple replicas across your cluster. Configure how many replicas run on each server from the service settings.

Replica count ranges from 1 to 10 per service.

## Serverless scaling

Public HTTP services can be configured to sleep when idle on proxy nodes. A
sleeping deployment keeps active traffic intent, records stopped runtime intent,
and stops the local container. The next public HTTP request wakes local
proxy-hosted deployments and is held until an upstream is ready or the wake
timeout is reached.

Worker-hosted deployments do not sleep. If a serverless-enabled service has only
worker replicas, it stays always on and routes directly. If a service has both
proxy and worker replicas, proxy replicas may sleep while worker replicas remain
routable.

For services with proxy-hosted serverless replicas, public traffic must be sent
only to proxy nodes that host a local proxy replica for that service. Non-owner
proxies do not emit a public HTTP route for the service, so DNS or the external
load balancer must avoid those proxies for that service's domains.

Serverless settings are configured per service:

| Setting           | Default | Description                                                       |
| ----------------- | ------- | ----------------------------------------------------------------- |
| Enable serverless | Off     | Allows proxy-hosted HTTP deployments to sleep and wake on request |
| Sleep after       | `300s`  | Idle period before running containers are stopped                 |
| Wake timeout      | `300s`  | Maximum time the wake gateway waits for ready upstreams           |

A cold wake starts the sleeping local proxy replicas for that host. Held
requests resume when one upstream is ready. If a worker upstream is already
ready, the gateway can serve it immediately while local proxy replicas wake in
the background.

Serverless services require at least one configured replica.

## Placement

Services use manual placement. Select the target servers and replica counts explicitly before deploying.

## Server Pinning

Stateful services (those with [volumes](/services/volumes)) are automatically pinned to a single server. This ensures the container always mounts the same local data path and avoids accidentally starting on a server that does not have the volume.

Pinning does not provide high availability. Volume data is not replicated across servers, and if the pinned server is lost, the service must be recovered from completed backups.

You can also manually lock any service to a specific server by setting the locked server. This is useful for workloads that need to run on a particular machine.

## Limitations

* Stateful services are limited to 1 replica.
* Stateful services are always pinned to their locked server.
* Stateful services do not automatically fail over to another server.
* Maximum 10 replicas per service.
* Serverless scaling requires a public HTTP service domain.
* Sleep and wake are proxy-local. Worker replicas are intentionally always on.
* Serverless traffic must be routed only to proxy nodes that own a local proxy replica for that service.
* Proxy agents report sleep and wake transitions through normal status reports.
