# NodeJS

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

## Metrics

| Metric                          | Unit     | Description                                                                                                     |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| cpu\_used                       | CPUs     | The total amount of CPUs used                                                                                   |
| cpu\_util                       | percents | The average CPU utilization % across all the CPUs (i.e., how much time on average the CPUs are busy doing work) |
| memory\_used                    | bytes    | The total amount of memory used                                                                                 |
| memory\_util                    | percent  | The average memory utilization %                                                                                |
| nodejs\_gc\_heap\_used          | bytes    | GC heap used                                                                                                    |
| nodejs\_rss                     | bytes    | Process Resident Set Size (RSS)                                                                                 |
| nodejs\_v8\_heap\_total         | bytes    | V8 heap total                                                                                                   |
| nodejs\_v8\_heap\_used          | bytes    | V8 heap used                                                                                                    |
| nodejs\_number\_active\_threads | threads  | Number of active threads                                                                                        |

## Parameters

| Parameter                               | Type        | Unit      | Default Value | Domain           | Restart | Description                                                                                                                                       |
| --------------------------------------- | ----------- | --------- | ------------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| v8\_allocation\_size\_pretenuring       | categorical |           | `true`        | `true`, `false`  | yes     | Pretenure with allocation sites                                                                                                                   |
| v8\_min\_semi\_space\_size              | integer     | megabytes | 0             | `0` → `1048576`  | yes     | Min size of a semi-space, the new space consists of two semi-spaces                                                                               |
| v8\_min\_semi\_space\_size              | integer     | megabytes | 0             | `0` → `1048576`  | yes     | Max size of a semi-space, the new space consists of two semi-spaces                                                                               |
| v8\_semi\_space\_grouth\_factor         | integer     |           | 2             | `0` → `100`      | yes     | Factor by which to grow the new space                                                                                                             |
| v8\_max\_old\_space\_size               | integer     | megabytes | 0             | `0` → `1048576`  | yes     | Max size of the old space                                                                                                                         |
| v8\_max\_heap\_size                     | integer     | megabytes | 0             | `0` → `1048576`  | yes     | 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. |
| v8\_initial\_heap\_size                 | integer     | megabytes | 0             | `0` → `1048576`  | yes     | Initial size of the heap                                                                                                                          |
| v8\_initial\_old\_space\_size           | integer     | megabytes | 0             | `0` → `1048576`  | yes     | Initial old space size                                                                                                                            |
| v8\_parallel\_scavenge                  | categorical |           | `true`        | `true`, `false`  | yes     | Parallel scavenge                                                                                                                                 |
| v8\_scavenge\_task\_trigger             | integer     |           | 80            | `1` → `100`      | yes     | Scavenge task trigger in percent of the current heap limit                                                                                        |
| v8\_scavenge\_separate\_stack\_scanning | categorical |           | `false`       | `true`, `false`  | yes     | Use a separate phase for stack scanning in scavenge                                                                                               |
| v8\_concurrent\_marking                 | categorical |           | `true`        | `true`, `false`  | yes     | Use concurrent marking                                                                                                                            |
| v8\_parallel\_marking                   | categorical |           | `true`        | `true`, `false`  | yes     | Use parallel marking in atomic pause                                                                                                              |
| v8\_concurrent\_sweeping                | categorical |           | `true`        | `true`, `false`  | yes     | Use concurrent sweeping                                                                                                                           |
| v8\_heap\_growing\_percent              | integer     |           | 0             | `0` → `99`       | yes     | Specifies heap growing factor as (1 + heap\_growing\_percent/100)                                                                                 |
| v8\_os\_page\_size                      | integer     | kylobytes | 0             | `0` → `1048576`  | yes     | Override OS page size                                                                                                                             |
| v8\_stack\_size                         | integer     | kylobytes | 984           | `16` → `1048576` | yes     | Default size of stack region v8 is allowed to use                                                                                                 |
| v8\_single\_threaded                    | categorical |           | `false`       | `true`, `false`  | yes     | Disable the use of background tasks                                                                                                               |
| v8\_single\_threaded\_gc                | categorical |           | `false`       | `true`, `false`  | yes     | Disable the use of background gc tasks                                                                                                            |
