Skip to content

Chromium Density & QPS Benchmarks - #6898

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

Chromium Density & QPS Benchmarks#6898
george-kalisse-sada wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
george-kalisse-sada:SADA_3b_chromium_qps_benchmarks

Conversation

@george-kalisse-sada

Copy link
Copy Markdown
Collaborator

Files: 2 new files

  • perfkitbenchmarker/linux_benchmarks/kubernetes/agentic/k8s_chromium_density_benchmark.py
  • perfkitbenchmarker/linux_benchmarks/kubernetes/agentic/k8s_qps_benchmark.py

Description: Adds two more GKE Agent Sandbox benchmarks:

Chromium Density: Measures browser interaction latency (navigate, evaluate, click, fill, screenshot) under concurrent Chromium sandbox sessions. Uses CDP (Chrome DevTools Protocol) from the orchestrator — no Node.js in the sandbox.

QPS Saturation: Measures scheduling throughput by firing sandbox claims at controlled QPS rates. Supports two modes: agent (via orchestrator API) and raw_claim (direct SandboxClaim creation via kubectl). Identifies the QPS saturation point where warm pool drain causes TTFE spikes.

@george-kalisse-sada
george-kalisse-sada force-pushed the SADA_3b_chromium_qps_benchmarks branch from 95239c9 to 8893ac8 Compare August 5, 2026 17:42
@roycaihw

roycaihw commented Aug 6, 2026

Copy link
Copy Markdown

/cc @Nishanth29


successful = result.get("successful_sessions", 0)
failed = result.get("failed_sessions", 0)
agg = result.get("aggregate", {})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the API returns aggregate as null on an error, reading metrics below might throw a None error. Can we do result.get("aggregate") or {} instead?

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

ns = FLAGS.k8s_agentic_namespace
logging.info("Cleanup: deleting SandboxClaims and draining warm pool.")

# Delete any lingering SandboxClaims to release claimed pods

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In Cleanup(), should we delete by label instead of --all so other workloads in the namespace don't get deleted?

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.

Good Catch, thanks. updated to use -l _WARMPOOL_LABEL so it strictly only deletes the Chromium claims generated by this benchmark.

_emit(samples, aggregate, "claim_p95_ms", "claim_p95", "ms", ns, extra)

# Throughput and counts
samples.append(

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 "samples" mean here? It seems to be more like "results". Please document.

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.

Samples is the list of perfkitbenchmarker.sample.Sample objects that PKB expects the Run() function to return. aggregate is the JSON dictionary of metrics calculated and returned by our FastAPI agent. Added inline documentation for these.

mode = FLAGS.k8s_qps_mode

if mode == "raw_claim":
return _RunRawClaim(benchmark_spec)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this "raw_claim" mode used & documented?

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.

Yes, it is. It is used to bypass the FastAPI agent entirely and fire SandboxClaims directly via kubectl to test the raw throughput of the Kubernetes API server and the SandboxController. I've added a brief inline comment here as well for clarity.

samples = []

# TTFE latency stats
_emit(samples, aggregate, "ttfe_mean_ms", "ttfe_mean", "ms", ns, extra)

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 are "samples" and "aggregate"? Please document.

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.

Samples is the list of perfkitbenchmarker.sample.Sample objects that PKB expects the Run() function to return. aggregate is the JSON dictionary of metrics calculated and returned by our FastAPI agent. Added inline documentation for these.

# TTFE latency stats (computed from raw claim results)
if ttfe_values:
n = len(ttfe_values)
samples.append(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why don't you use _emit here and below?

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.

This is just due to an architectural difference between the two modes.
In agent mode, the FastAPI agent calculates all the percentiles and returns them in the aggregate dictionary, which our utility function parses. In raw_claim mode, we bypass the agent completely. The Python script collects the raw timestamps and calculates the percentiles locally using the _percentile() helper. Because we don't have an aggregate dictionary from the API, we append the sample.Sample objects directly.

ns,
extra,
)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See my comments in the previous PR. Please simplify the code by leverage reusable utility methods.

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.

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