# Reference: tenants

URL: https://scalws.com/docs/reference/tenants/
Source: `docs/reference/schema` in the ScalWS repository

<h3 id="tenants"><code>tenants</code></h3>

| | |
|---|---|
| Syntax | `tenants: [{...}, ...]` |
| Default | `[]` |
| Context | `scalws.yaml` |
| Reload | applies on reload |

Tenants (accounts) with their applications.


<h3 id="tenants-.name"><code>tenants[].name</code></h3>

| | |
|---|---|
| Syntax | `name: <string>` |
| Default | `required` |
| Context | `tenants[]` |
| Reload | applies on reload |

Tenant name: 1-63 characters of a-z, 0-9, `-`, `_`, starting with a letter.


<h3 id="tenants-.resources"><code>tenants[].resources</code></h3>

| | |
|---|---|
| Syntax | `resources: {...}` |
| Default | `see the fields below` |
| Context | `tenants[]` |
| Reload | applies on reload |

Resource limits for all of the tenant's applications together.


<h3 id="tenants-.resources.burst"><code>tenants[].resources.burst</code></h3>

| | |
|---|---|
| Syntax | `burst: <integer>` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

Token-bucket burst for `requests_per_second` (default: equal to the rate).


<h3 id="tenants-.resources.cpu"><code>tenants[].resources.cpu</code></h3>

| | |
|---|---|
| Syntax | `cpu: <cpu quota> (e.g. "400%")` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`cpu.max`, e.g. `"400%"` = four CPUs.


<h3 id="tenants-.resources.io_bandwidth"><code>tenants[].resources.io_bandwidth</code></h3>

| | |
|---|---|
| Syntax | `io_bandwidth: <size> (e.g. 16KiB)` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`io.max`: read and write bytes per second each, on every disk holding the tenant's application roots, e.g. `"20MiB"`.


<h3 id="tenants-.resources.io_weight"><code>tenants[].resources.io_weight</code></h3>

| | |
|---|---|
| Syntax | `io_weight: <integer>` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`io.weight` (1-10000, default 100), best effort: needs a weight-capable I/O scheduler.


<h3 id="tenants-.resources.max_concurrent_requests"><code>tenants[].resources.max_concurrent_requests</code></h3>

| | |
|---|---|
| Syntax | `max_concurrent_requests: <integer>` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

Requests of this tenant processed concurrently; excess gets 503.


<h3 id="tenants-.resources.memory"><code>tenants[].resources.memory</code></h3>

| | |
|---|---|
| Syntax | `memory: <size> (e.g. 16KiB)` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`memory.max`.


<h3 id="tenants-.resources.pids"><code>tenants[].resources.pids</code></h3>

| | |
|---|---|
| Syntax | `pids: <integer>` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`pids.max`.


<h3 id="tenants-.resources.requests_per_second"><code>tenants[].resources.requests_per_second</code></h3>

| | |
|---|---|
| Syntax | `requests_per_second: <integer>` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

Sustained request rate; excess gets 429.


<h3 id="tenants-.resources.swap"><code>tenants[].resources.swap</code></h3>

| | |
|---|---|
| Syntax | `swap: <size> (e.g. 16KiB)` |
| Default | `none` |
| Context | `tenants[].resources` |
| Reload | applies on reload |

`memory.swap.max` when `memory` is set; default 0 (no swap).


<h3 id="tenants-.user"><code>tenants[].user</code></h3>

| | |
|---|---|
| Syntax | `user: <string>` |
| Default | `none` |
| Context | `tenants[]` |
| Reload | applies on reload |

Unix account the tenant's managed processes run as (Linux, ADR-0026).
