Dynamic V8 Heap Resizing for Kubernetes In-Place Scaling (--max-old-space-size-percentage)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, kubernetes, nodejs
調査の方向性
まず --max-old-space-size-percentage の実装と、それが読み取る cgroup メモリパラメータから始め、次に V8 isolate の制限を実行時に更新する方法を調査します。Kubernetes InPlacePodVerticalScaling、およびメモリの増加と減少の両方に対して設計を検証します。完了の条件は、再起動せずに実行時の制限が変更された後、パーセンテージが再適用されることです。
索引モデルが issue の本文から書いたものです。
説明
What is the problem this feature will solve?
Node.js supports percentage-based heap configuration via --max-old-space-size-percentage. However, this flag currently calculates V8's maximum old space size only once at process startup based on initial system or cgroup memory limits.
Kubernetes supports in-place resource resizing (InPlacePodVerticalScaling), which alters container memory limits dynamically at runtime without restarting the container. Because --max-old-space-size-percentage evaluates only at startup, it cannot react to runtime cgroup changes:
- Memory Upscaling: If Kubernetes increases a running container's memory limit, Node.js remains restricted to the initial V8 heap limit calculated at startup, failing to utilize the newly available RAM.
- Memory Downscaling: If Kubernetes decreases the container's memory limit below the initial V8 heap allocation, the container risks being terminated by the Linux Out-Of-Memory (OOM) killer before V8 triggers garbage collection or lowers its heap boundary.
To fully support zero-downtime Kubernetes in-place resizing, --max-old-space-size-percentage needs to dynamically recalculate and apply heap limits when cgroup memory parameters change at runtime.
What is the feature you are proposing to solve the problem?
Extend --max-old-space-size-percentage to actively monitor cgroup memory limit changes and adjust the V8 heap size dynamically during process execution.
Example Workflow
# Enable percentage-based allocation
node --max-old-space-size-percentage=80 app.js
- Initialization: Container starts with a 2 GiB memory limit. Node.js evaluates
--max-old-space-size-percentage=80and sets V8 max old space to~1.6 GiB. - Kubernetes Event: Kubernetes resizes the running pod in-place from 2 GiB to 4 GiB memory limit.
- Event Detection: Node.js detects the cgroup change event.
- Runtime Update: Node.js recalculates 80% of 4 GiB (
~3.2 GiB) and adjusts V8's isolate limits dynamically while the application continues processing traffic.
What alternatives have you considered?
No response
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.4k
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 279
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node のほかの issue
-
doc
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
bug customer-eng Durable Agents Inngest status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/OrgExplorer#253 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100