# Reference: server.limits

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

<h3 id="server.limits.body_read_timeout"><code>server.limits.body_read_timeout</code></h3>

| | |
|---|---|
| Syntax | `body_read_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `server.limits` |
| Reload | applies on reload |

Maximum gap between request body chunks.


<h3 id="server.limits.h2_max_concurrent_streams"><code>server.limits.h2_max_concurrent_streams</code></h3>

| | |
|---|---|
| Syntax | `h2_max_concurrent_streams: <integer>` |
| Default | `128` |
| Context | `server.limits` |
| Reload | applies on reload |

HTTP/2 streams a client may have open at once on one connection.


<h3 id="server.limits.header_read_timeout"><code>server.limits.header_read_timeout</code></h3>

| | |
|---|---|
| Syntax | `header_read_timeout: <duration> (e.g. 30s)` |
| Default | `15s` |
| Context | `server.limits` |
| Reload | applies on reload |

HTTP/1: time allowed to receive a complete request head; also bounds keep-alive idle.


<h3 id="server.limits.idle_timeout"><code>server.limits.idle_timeout</code></h3>

| | |
|---|---|
| Syntax | `idle_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `server.limits` |
| Reload | applies on reload |

Close connections (h1 and h2) with no in-flight request for this long.


<h3 id="server.limits.max_connections"><code>server.limits.max_connections</code></h3>

| | |
|---|---|
| Syntax | `max_connections: <integer>` |
| Default | `10000` |
| Context | `server.limits` |
| Reload | needs a restart |

Open client connections across all listeners; further connections wait in the kernel backlog.


<h3 id="server.limits.max_header_bytes"><code>server.limits.max_header_bytes</code></h3>

| | |
|---|---|
| Syntax | `max_header_bytes: <size> (e.g. 16KiB)` |
| Default | `16KiB` |
| Context | `server.limits` |
| Reload | applies on reload |

Total size of a request's headers.


<h3 id="server.limits.max_headers"><code>server.limits.max_headers</code></h3>

| | |
|---|---|
| Syntax | `max_headers: <integer>` |
| Default | `100` |
| Context | `server.limits` |
| Reload | applies on reload |

Number of request headers.


<h3 id="server.limits.max_request_body_bytes"><code>server.limits.max_request_body_bytes</code></h3>

| | |
|---|---|
| Syntax | `max_request_body_bytes: <size> (e.g. 16KiB)` |
| Default | `10MiB` |
| Context | `server.limits` |
| Reload | applies on reload |

Size of a request body.


<h3 id="server.limits.max_upgraded_connections"><code>server.limits.max_upgraded_connections</code></h3>

| | |
|---|---|
| Syntax | `max_upgraded_connections: <integer>` |
| Default | `10000` |
| Context | `server.limits` |
| Reload | read when the process starts |

Concurrent upgraded (WebSocket) tunnels across all applications.


<h3 id="server.limits.max_uri_bytes"><code>server.limits.max_uri_bytes</code></h3>

| | |
|---|---|
| Syntax | `max_uri_bytes: <size> (e.g. 16KiB)` |
| Default | `8KiB` |
| Context | `server.limits` |
| Reload | applies on reload |

Length of the request target (path and query); longer requests get 414.


<h3 id="server.limits.shutdown_delay"><code>server.limits.shutdown_delay</code></h3>

| | |
|---|---|
| Syntax | `shutdown_delay: <duration> (e.g. 30s)` |
| Default | `0s` |
| Context | `server.limits` |
| Reload | applies on reload |

After SIGTERM, keep serving for this long while `/readyz` answers 503, so load balancers stop sending new requests before the drain starts.


<h3 id="server.limits.shutdown_timeout"><code>server.limits.shutdown_timeout</code></h3>

| | |
|---|---|
| Syntax | `shutdown_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `server.limits` |
| Reload | applies on reload |

Time in-flight requests get to finish when the server stops.


<h3 id="server.limits.tls_handshake_timeout"><code>server.limits.tls_handshake_timeout</code></h3>

| | |
|---|---|
| Syntax | `tls_handshake_timeout: <duration> (e.g. 30s)` |
| Default | `10s` |
| Context | `server.limits` |
| Reload | applies on reload |

Time a client has to complete the TLS handshake.


<h3 id="server.limits.upgraded_idle_timeout"><code>server.limits.upgraded_idle_timeout</code></h3>

| | |
|---|---|
| Syntax | `upgraded_idle_timeout: <duration> (e.g. 30s)` |
| Default | `300s` |
| Context | `server.limits` |
| Reload | read when the process starts |

Close an upgraded tunnel with no traffic in either direction for this long.


<h3 id="server.limits.write_timeout"><code>server.limits.write_timeout</code></h3>

| | |
|---|---|
| Syntax | `write_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `server.limits` |
| Reload | applies on reload |

Close a connection whose writes make no progress for this long (slow readers).
