snapshot.diff.ratio memfile baseline is path-dependent (template vs last-snapshot) — misleads skip/no-op analysis

オープン 初心者向け
#3,754 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, prometheus
領域
observability

調査の方向性

sandbox.goから始め、applyInPlaceExportUnionと、orchestrator.sandbox.snapshot.diff.ratioおよび.bytesのスナップショット差分メトリクスの定義をたどってください。in-placeのチェックポイントと破棄経路のチェックポイントで、memfileのベースラインがどう異なるかを確認し、その違いをメトリクスの説明に記載するか、ベースライン属性を追加してください。ユーザーがテンプレートのベースラインと最後のスナップショットのベースラインを区別できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

orchestrator.sandbox.snapshot.diff.ratio / .bytes for file_type=memfile are measured against different baselines depending on the checkpoint path, which makes the memory ratio easy to misread as "how much changed this pause."

Detail

  • In-place checkpoint: the memory export advances a cumulative baseline (applyInPlaceExportUnion, sandbox.go), so the diff is roughly "since the last in-place checkpoint."
  • Destroy-path pause (the common autopause / pause→resume-fresh path): the memory diff is parented on the ORIGINAL template, not the previous snapshot. The in-code comment says it outright:

    "In-place checkpoints parent every diff on the ORIGINAL template header ... Only the in-place path advances the baseline — a destroyed sandbox has no next interval."

So on the destroy path the memfile diff reflects the resume working set (pages faulted/written since the template loaded), not the change since the last snapshot. A genuine no-op pause still reports a large memfile dirty ratio.

Impact

Anyone using snapshot.diff.ratio{file_type=memfile} to gauge "did memory change this pause" (e.g. to size a skip-unchanged / fs-only-downgrade opportunity) will over-count memory change on the destroy path. The rootfs dimension is a true diff and is not affected.

Suggestion

Either (a) add a baseline ∈ {template, last_snapshot} attribute to the diff metrics so dashboards can separate the two, or (b) document the path-dependent baseline in the metric description. No behavior change.

Context: surfaced while measuring the no-op-pause rate for a possible skip-unchanged feature (see the change_footprint metric PR). On a synthetic dev workload the memfile dirty sat in a stable ~115-134 MB band on every pause regardless of work — the template-baseline artifact, not real per-pause churn.

主要言語
Go
スター
1.8k
フォーク
503
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

e2b-dev/runtime のほかの issue

e2b-dev/runtime の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。