Skip to content

Pod Snapshot Benchmark - #6900

Open
george-kalisse-sada wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
george-kalisse-sada:SADA_3d_snapshot_benchmark
Open

Pod Snapshot Benchmark#6900
george-kalisse-sada wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
george-kalisse-sada:SADA_3d_snapshot_benchmark

Conversation

@george-kalisse-sada

Copy link
Copy Markdown
Collaborator

Files: 1 new file

  • perfkitbenchmarker/linux_benchmarks/kubernetes/agentic/k8s_snapshot_benchmark.py

Description: Adds the GKE Pod Snapshot saturation benchmark:

Pod Snapshot: Measures GKE Pod Snapshot create/restore latency under varying memory preload sizes. Creates source pods with configurable memory footprints, triggers CRIU checkpoints to GCS-backed storage, restores from snapshots, and measures TTFE (Time To First Execution) for restored pods. Includes:

  • Concurrent burst support (multiple source/snapshot/restore pods in parallel)
  • Snapshot correctness verification (counter continuity check)
  • --skip_snapshot mode for cold-start TTFE measurement (no snapshot/restore)
  • --preload_mode=script:<path> for custom startup scripts (vibe coding simulation)
  • DeploySnapshots() integration for GCS bucket, managed folder, KSA, and IAM setup

This is the only benchmark that uses GKE Pod Snapshots (CRIU + GCS), PodSnapshotManualTrigger CRDs, and creates its own SandboxTemplates per measurement (rather than using the shared warm pool).

@george-kalisse-sada
george-kalisse-sada force-pushed the SADA_3d_snapshot_benchmark branch from ffbd559 to 18c8521 Compare August 5, 2026 17:43
@roycaihw

roycaihw commented Aug 6, 2026

Copy link
Copy Markdown

/cc @pmandewalkar

pool.submit(_ApplyClaim, sname, namespace, step_template)

logging.info("Waiting for %d source pod(s) Running + preload", burst_size)
with ThreadPoolExecutor(max_workers=workers) as pool:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to batch the polling to see the status of all pods at once (we could maybe use label selectors). I'm worried that 100 subprocesses could be an issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Snapshot benchmark tests heavy I/O state hydration, The burst_size defaults to 1, and in our saturation sweeps, we only pushed it to a maximum of 5. This can be more of a concern for very high-scale tests.

@george-kalisse-sada
george-kalisse-sada force-pushed the SADA_3d_snapshot_benchmark branch from 18c8521 to 2b8ab93 Compare August 13, 2026 03:42

@roycaihw roycaihw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to follow what this benchmark is doing with many unclear variable names / abbreviations and a long script. I think this one needs better documentation and potentially splitting the huge script into smaller meaningful methods

preload_mode: str,
) -> bool:
"""Render a SandboxTemplate that runs a user-provided startup script."""
script_path = preload_mode.split(":", 1)[1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document the schema of preload_mode

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. schema expects script:<absolute_path_to_script>.

],
"nodeSelector": _get_sandbox_node_selector(),
"tolerations": _get_sandbox_tolerations(),
"restartPolicy": "OnFailure",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we move the yaml template into separate template files? I see you doing that in other places and PRs. Shall we be consistent?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually kept this one inline using json.dumps() because are dynamically injecting a multi-line bash script (read from the workload scripts) into the container's args array, and JSON serialization handles complex string escaping and newlines automatically and safely. YAML Jinja templating can be highly prone to indentation breaks and escaping errors.


logging.info("Waiting for %d source pod(s) Running + preload", burst_size)
with ThreadPoolExecutor(max_workers=workers) as pool:
source_futs = [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "futs" stand for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was shorthand for futures (from the ThreadPoolExecutor). Renamed all instances of futs to futures.

) -> dict:
"""Execute one full snapshot/restore cycle and return a result dict.

Handles source creation, snapshot, restore, TTFE measurement,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does source mean?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It refers to the original pod that boots up and runs the preload script, whose state is then captured by the snapshot. I've updated the docstring for _RunSnapshotCycle to explicitly define this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants