# NodeJS

This page describes the Optimization Pack for the component type NodeJS.

## Metrics

<table><thead><tr><th>Metric</th><th width="120">Unit</th><th width="299.3333333333333">Description</th></tr></thead><tbody><tr><td>cpu_used</td><td>CPUs</td><td>The total amount of CPUs used</td></tr><tr><td>cpu_util</td><td>percents</td><td>The average CPU utilization % across all the CPUs (i.e., how much time on average the CPUs are busy doing work)</td></tr><tr><td>memory_used</td><td>bytes</td><td>The total amount of memory used</td></tr><tr><td>memory_util</td><td>percent</td><td>The average memory utilization %</td></tr><tr><td>nodejs_gc_heap_used</td><td>bytes</td><td>GC heap used</td></tr><tr><td>nodejs_rss</td><td>bytes</td><td>Process Resident Set Size (RSS)</td></tr><tr><td>nodejs_v8_heap_total</td><td>bytes</td><td>V8 heap total</td></tr><tr><td>nodejs_v8_heap_used</td><td>bytes</td><td>V8 heap used</td></tr><tr><td>nodejs_number_active_threads</td><td>threads</td><td>Number of active threads</td></tr></tbody></table>

## Parameters

<table><thead><tr><th width="282">Parameter</th><th width="136">Type</th><th width="120">Unit</th><th width="167">Default Value</th><th width="180">Domain</th><th width="89">Restart</th><th width="343">Description</th></tr></thead><tbody><tr><td>v8_allocation_size_pretenuring</td><td>categorical</td><td></td><td><code>true</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Pretenure with allocation sites</td></tr><tr><td>v8_min_semi_space_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Min size of a semi-space, the new space consists of two semi-spaces</td></tr><tr><td>v8_min_semi_space_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Max size of a semi-space, the new space consists of two semi-spaces</td></tr><tr><td>v8_semi_space_grouth_factor</td><td>integer</td><td></td><td>2</td><td><code>0</code> → <code>100</code></td><td>yes</td><td>Factor by which to grow the new space</td></tr><tr><td>v8_max_old_space_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Max size of the old space</td></tr><tr><td>v8_max_heap_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Max size of the heap both max_semi_space_size and max_old_space_size take precedence. All three flags cannot be specified at the same time.</td></tr><tr><td>v8_initial_heap_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Initial size of the heap</td></tr><tr><td>v8_initial_old_space_size</td><td>integer</td><td>megabytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Initial old space size</td></tr><tr><td>v8_parallel_scavenge</td><td>categorical</td><td></td><td><code>true</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Parallel scavenge</td></tr><tr><td>v8_scavenge_task_trigger</td><td>integer</td><td></td><td>80</td><td><code>1</code> → <code>100</code></td><td>yes</td><td>Scavenge task trigger in percent of the current heap limit</td></tr><tr><td>v8_scavenge_separate_stack_scanning</td><td>categorical</td><td></td><td><code>false</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Use a separate phase for stack scanning in scavenge</td></tr><tr><td>v8_concurrent_marking</td><td>categorical</td><td></td><td><code>true</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Use concurrent marking</td></tr><tr><td>v8_parallel_marking</td><td>categorical</td><td></td><td><code>true</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Use parallel marking in atomic pause</td></tr><tr><td>v8_concurrent_sweeping</td><td>categorical</td><td></td><td><code>true</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Use concurrent sweeping</td></tr><tr><td>v8_heap_growing_percent</td><td>integer</td><td></td><td>0</td><td><code>0</code> → <code>99</code></td><td>yes</td><td>Specifies heap growing factor as (1 + heap_growing_percent/100)</td></tr><tr><td>v8_os_page_size</td><td>integer</td><td>kylobytes</td><td>0</td><td><code>0</code> → <code>1048576</code></td><td>yes</td><td>Override OS page size</td></tr><tr><td>v8_stack_size</td><td>integer</td><td>kylobytes</td><td>984</td><td><code>16</code> → <code>1048576</code></td><td>yes</td><td>Default size of stack region v8 is allowed to use</td></tr><tr><td>v8_single_threaded</td><td>categorical</td><td></td><td><code>false</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Disable the use of background tasks</td></tr><tr><td>v8_single_threaded_gc</td><td>categorical</td><td></td><td><code>false</code></td><td><code>true</code>, <code>false</code></td><td>yes</td><td>Disable the use of background gc tasks</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.1.2/akamas-reference/optimization-packs/nodejs-pack/nodejs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
