# services.<name>.replicas

> Number of copies.

Number of copies. An integer fixes the count; an object enables autoscaling.

- **Type:** integer or object
- **Since:** manifest v1

**Accepted forms**

- integer
- object: the full form, with the fields below

## Example

```yaml
services:
  web:
    replicas: 2
```

```yaml
services:
  web:
    replicas:
      min: 2
      max: 6
      scale_on:
        cpu: 70%
```

## Fields

### min

`services.<name>.replicas.min`

Fewest replicas. 0 allows scaling to zero.

- **Type:** integer
- **Default:** `1`
- **Range:** 0 to 20
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      min: 2
```

### max

`services.<name>.replicas.max`

Most replicas.

- **Type:** integer
- **Range:** 1 to 20
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      max: 6
```

### scale_on

`services.<name>.replicas.scale_on`

Targets for horizontal autoscaling between `min` and `max`.

- **Type:** object
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      scale_on:
        cpu: 70%
        concurrency: 80
```

#### cpu

`services.<name>.replicas.scale_on.cpu`

Average CPU use, as a percentage of the limit.

- **Type:** [percent](/docs/manifest/#percent)
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      scale_on:
        cpu: 70%
```

#### memory

`services.<name>.replicas.scale_on.memory`

Average memory use, as a percentage of the limit.

- **Type:** [percent](/docs/manifest/#percent)
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      scale_on:
        memory: 80%
```

#### concurrency

`services.<name>.replicas.scale_on.concurrency`

In-flight requests per replica, measured at the edge.

- **Type:** integer
- **Range:** 1 to …
- **Since:** manifest v1

```yaml
services:
  web:
    replicas:
      scale_on:
        concurrency: 80
```

## See also

- [services](/docs/manifest/services/): all fields of `services`
- [guv.yaml reference](/docs/manifest/)
