# defaults.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
defaults:
  replicas: 2
```

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

## Fields

### min

`defaults.replicas.min`

Fewest replicas. 0 allows scaling to zero.

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

```yaml
defaults:
  replicas:
    min: 2
```

### max

`defaults.replicas.max`

Most replicas.

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

```yaml
defaults:
  replicas:
    max: 6
```

### scale_on

`defaults.replicas.scale_on`

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

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

```yaml
defaults:
  replicas:
    scale_on:
      cpu: 70%
      concurrency: 80
```

#### cpu

`defaults.replicas.scale_on.cpu`

Average CPU use, as a percentage of the limit.

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

```yaml
defaults:
  replicas:
    scale_on:
      cpu: 70%
```

#### memory

`defaults.replicas.scale_on.memory`

Average memory use, as a percentage of the limit.

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

```yaml
defaults:
  replicas:
    scale_on:
      memory: 80%
```

#### concurrency

`defaults.replicas.scale_on.concurrency`

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

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

```yaml
defaults:
  replicas:
    scale_on:
      concurrency: 80
```

## See also

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