# Reference: runtime type node

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

<h3 id="tenants-.applications-.routes-.runtime.node.command"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.command</code></h3>

| | |
|---|---|
| Syntax | `command: [<string>, ...]` |
| Default | `[]` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Command started by scalws (no shell), e.g. `[node, server.js]`; the application listens on `PORT`.


<h3 id="tenants-.applications-.routes-.runtime.node.env"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.env</code></h3>

| | |
|---|---|
| Syntax | `env: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Environment variables for the process.


<h3 id="tenants-.applications-.routes-.runtime.node.health_path"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.health_path</code></h3>

| | |
|---|---|
| Syntax | `health_path: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Optional readiness path; any non-5xx answer counts as ready.


<h3 id="tenants-.applications-.routes-.runtime.node.listen"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.listen</code></h3>

| | |
|---|---|
| Syntax | `listen: unix \| tcp` |
| Default | `unix` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

`unix`: a socket under `runtime_dir` passed as `PORT`; `tcp`: a free loopback port.


<h3 id="tenants-.applications-.routes-.runtime.node.response_timeout"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.response_timeout</code></h3>

| | |
|---|---|
| Syntax | `response_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Time to wait for the response headers of the application.


<h3 id="tenants-.applications-.routes-.runtime.node.startup_timeout"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.startup_timeout</code></h3>

| | |
|---|---|
| Syntax | `startup_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Time the process gets to become ready.


<h3 id="tenants-.applications-.routes-.runtime.node.stop_timeout"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.stop_timeout</code></h3>

| | |
|---|---|
| Syntax | `stop_timeout: <duration> (e.g. 30s)` |
| Default | `10s` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Time the process gets to exit after SIGTERM before it is killed.


<h3 id="tenants-.applications-.routes-.runtime.node.upstream"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.upstream</code></h3>

| | |
|---|---|
| Syntax | `upstream: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Proxy to a Node.js process managed elsewhere instead of starting one.


<h3 id="tenants-.applications-.routes-.runtime.node.workers"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.workers</code></h3>

| | |
|---|---|
| Syntax | `workers: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: node)` |
| Reload | applies on reload |

Number of processes (`min`); requests are balanced across ready ones.


<h3 id="tenants-.applications-.routes-.runtime.node.workers.autoscale"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.workers.autoscale</code></h3>

| | |
|---|---|
| Syntax | `autoscale: off \| auto \| recommend` |
| Default | `recommend` |
| Context | `tenants[].applications[].routes[].runtime<node>.workers` |
| Reload | applies on reload |

`off`, `recommend` (default) or `auto` (ADR-0014).


<h3 id="tenants-.applications-.routes-.runtime.node.workers.max"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.workers.max</code></h3>

| | |
|---|---|
| Syntax | `max: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].routes[].runtime<node>.workers` |
| Reload | applies on reload |

Upper bound when the pool is scaled.


<h3 id="tenants-.applications-.routes-.runtime.node.workers.min"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.workers.min</code></h3>

| | |
|---|---|
| Syntax | `min: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].routes[].runtime<node>.workers` |
| Reload | applies on reload |

Processes started at the beginning and kept at least.


<h3 id="tenants-.applications-.routes-.runtime.node.workers.target_concurrency"><code>tenants[].applications[].routes[].runtime&lt;node&gt;.workers.target_concurrency</code></h3>

| | |
|---|---|
| Syntax | `target_concurrency: <integer>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime<node>.workers` |
| Reload | applies on reload |

Concurrent requests one worker is expected to handle well (utilisation basis).


<h3 id="tenants-.applications-.runtime.node.command"><code>tenants[].applications[].runtime&lt;node&gt;.command</code></h3>

| | |
|---|---|
| Syntax | `command: [<string>, ...]` |
| Default | `[]` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Command started by scalws (no shell), e.g. `[node, server.js]`; the application listens on `PORT`.


<h3 id="tenants-.applications-.runtime.node.env"><code>tenants[].applications[].runtime&lt;node&gt;.env</code></h3>

| | |
|---|---|
| Syntax | `env: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Environment variables for the process.


<h3 id="tenants-.applications-.runtime.node.health_path"><code>tenants[].applications[].runtime&lt;node&gt;.health_path</code></h3>

| | |
|---|---|
| Syntax | `health_path: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Optional readiness path; any non-5xx answer counts as ready.


<h3 id="tenants-.applications-.runtime.node.listen"><code>tenants[].applications[].runtime&lt;node&gt;.listen</code></h3>

| | |
|---|---|
| Syntax | `listen: unix \| tcp` |
| Default | `unix` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

`unix`: a socket under `runtime_dir` passed as `PORT`; `tcp`: a free loopback port.


<h3 id="tenants-.applications-.runtime.node.response_timeout"><code>tenants[].applications[].runtime&lt;node&gt;.response_timeout</code></h3>

| | |
|---|---|
| Syntax | `response_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Time to wait for the response headers of the application.


<h3 id="tenants-.applications-.runtime.node.startup_timeout"><code>tenants[].applications[].runtime&lt;node&gt;.startup_timeout</code></h3>

| | |
|---|---|
| Syntax | `startup_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Time the process gets to become ready.


<h3 id="tenants-.applications-.runtime.node.stop_timeout"><code>tenants[].applications[].runtime&lt;node&gt;.stop_timeout</code></h3>

| | |
|---|---|
| Syntax | `stop_timeout: <duration> (e.g. 30s)` |
| Default | `10s` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Time the process gets to exit after SIGTERM before it is killed.


<h3 id="tenants-.applications-.runtime.node.upstream"><code>tenants[].applications[].runtime&lt;node&gt;.upstream</code></h3>

| | |
|---|---|
| Syntax | `upstream: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Proxy to a Node.js process managed elsewhere instead of starting one.


<h3 id="tenants-.applications-.runtime.node.workers"><code>tenants[].applications[].runtime&lt;node&gt;.workers</code></h3>

| | |
|---|---|
| Syntax | `workers: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: node)` |
| Reload | applies on reload |

Number of processes (`min`); requests are balanced across ready ones.


<h3 id="tenants-.applications-.runtime.node.workers.autoscale"><code>tenants[].applications[].runtime&lt;node&gt;.workers.autoscale</code></h3>

| | |
|---|---|
| Syntax | `autoscale: off \| auto \| recommend` |
| Default | `recommend` |
| Context | `tenants[].applications[].runtime<node>.workers` |
| Reload | applies on reload |

`off`, `recommend` (default) or `auto` (ADR-0014).


<h3 id="tenants-.applications-.runtime.node.workers.max"><code>tenants[].applications[].runtime&lt;node&gt;.workers.max</code></h3>

| | |
|---|---|
| Syntax | `max: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].runtime<node>.workers` |
| Reload | applies on reload |

Upper bound when the pool is scaled.


<h3 id="tenants-.applications-.runtime.node.workers.min"><code>tenants[].applications[].runtime&lt;node&gt;.workers.min</code></h3>

| | |
|---|---|
| Syntax | `min: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].runtime<node>.workers` |
| Reload | applies on reload |

Processes started at the beginning and kept at least.


<h3 id="tenants-.applications-.runtime.node.workers.target_concurrency"><code>tenants[].applications[].runtime&lt;node&gt;.workers.target_concurrency</code></h3>

| | |
|---|---|
| Syntax | `target_concurrency: <integer>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime<node>.workers` |
| Reload | applies on reload |

Concurrent requests one worker is expected to handle well (utilisation basis).
