From 398225e2b645e6dc415098634e07f0779111c789 Mon Sep 17 00:00:00 2001 From: harrider <22509508+harrider@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:31:14 -0500 Subject: [PATCH 1/2] Add environment variables for logging node heap stats --- overview.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/overview.md b/overview.md index bd12b6f..384bb27 100644 --- a/overview.md +++ b/overview.md @@ -356,6 +356,8 @@ The environmental variables for the clearlydefined-api-dev App Service include: * HARVEST_QUEUE_PREFIX * HARVEST_QUEUE_PROVIDER * HARVESTER_PROVIDER +* LOG_NODE_HEAPSTATS +* LOG_NODE_HEAPSTATS_INTERVAL_MS * NODE_ENV * RATE_LIMIT_MAX * RATE_LIMIT_WINDOW @@ -535,6 +537,22 @@ This is the prefix we use for queues that we use for harvesting. In this case, i This indicates what type of service we use for harvesting, in this case it's **crawlerQueue**, which corresponds with the [crawlerQueue harvest provider](https://github.com/clearlydefined/service/blob/master/providers/harvest/crawlerQueue.js) +**LOG_NODE_HEAPSTATS** +This is an optional flag to `enable` logging of Node's `v8` module's memory usage data using the `getHeapSpaceStatistics` and `getHeapStatistics()` functions. + +Value is either `true` or `false` +> Note: if this env var is not present, it equates to `false` + +- [Node.js v8 engine docs - getHeapSpaceStatistics()](https://nodejs.org/docs/v22.12.0/api/v8.html#v8getheapspacestatistics) + +- [Node.js v8 engine docs - getHeapStatistics()](https://nodejs.org/docs/v22.12.0/api/v8.html#v8getheapstatistics) + +**LOG_NODE_HEAPSTATS_INTERVAL_MS** + +This is an optional environment variable that sets the interval to log heap statistics (When enabled). This is a number in `ms` (`milliseconds`). + +> NOTE: The default value is `30,000 ms` (`30 seconds`) + **MULTIVERSION_CURATION_FF** This is a feature flag that indicates whether the [Multi-version curation feature](https://github.com/clearlydefined/service/pull/810) is active. From 8158d6635ca36c6cfd609cbbb9c40d05eb7f8155 Mon Sep 17 00:00:00 2001 From: harrider <22509508+harrider@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:36:28 -0500 Subject: [PATCH 2/2] Add examples for new env vars --- overview.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/overview.md b/overview.md index 384bb27..4b3d08a 100644 --- a/overview.md +++ b/overview.md @@ -543,15 +543,22 @@ This is an optional flag to `enable` logging of Node's `v8` module's memory usag Value is either `true` or `false` > Note: if this env var is not present, it equates to `false` +> example: +> `LOG_NODE_HEAPSTATS` = `true` + - [Node.js v8 engine docs - getHeapSpaceStatistics()](https://nodejs.org/docs/v22.12.0/api/v8.html#v8getheapspacestatistics) - [Node.js v8 engine docs - getHeapStatistics()](https://nodejs.org/docs/v22.12.0/api/v8.html#v8getheapstatistics) **LOG_NODE_HEAPSTATS_INTERVAL_MS** -This is an optional environment variable that sets the interval to log heap statistics (When enabled). This is a number in `ms` (`milliseconds`). +This is an optional environment variable that sets the interval to log heap statistics (When enabled). + +Value is a number in `ms` (`milliseconds`). +> NOTE: The default value is `30000` ms (`30` seconds) -> NOTE: The default value is `30,000 ms` (`30 seconds`) +> example: +> `LOG_NODE_HEAPSTATS_INTERVAL_MS` = `10000` **MULTIVERSION_CURATION_FF**