Skip to content

Warmpool & Deletion Benchmarks - #6899

Open
george-kalisse-sada wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
george-kalisse-sada:SADA_3c_warmpool_deletion_benchmarks
Open

Warmpool & Deletion Benchmarks#6899
george-kalisse-sada wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
george-kalisse-sada:SADA_3c_warmpool_deletion_benchmarks

Conversation

@george-kalisse-sada

Copy link
Copy Markdown
Collaborator

Files: 2 new files

  • perfkitbenchmarker/linux_benchmarks/kubernetes/agentic/k8s_warmpool_benchmark.py
  • perfkitbenchmarker/linux_benchmarks/kubernetes/agentic/k8s_deletion_benchmark.py

Description: Adds two infrastructure lifecycle benchmarks:

Warmpool Scale-Up: Measures how quickly N sandbox pods can be provisioned from zero via the SandboxWarmPool controller. Scrapes pod lifecycle timestamps (creationTimestamp, PodScheduled condition, Ready condition) for time-to-created/scheduled/running percentiles. No agent API needed — interacts directly with the Kubernetes API.

Deletion & Cleanup: Measures bulk deletion efficiency and IP address reclamation. Provisions N pods via SandboxWarmPool, bulk-deletes them by scaling to zero, and tracks per-pod deletion latency and IPAM release timing. Tests whether "Terminating" pods hold IP addresses longer than expected.

@george-kalisse-sada
george-kalisse-sada force-pushed the SADA_3c_warmpool_deletion_benchmarks branch from f66a61f to a524471 Compare August 5, 2026 17:43
@roycaihw

roycaihw commented Aug 6, 2026

Copy link
Copy Markdown

/cc @pmandewalkar


# Drain to 0 for clean measurement (moved from Prepare for sweep compatibility)
utils.DrainWarmPool(ns, warmpool_name, label, timeout=int(drain_timeout))
time.sleep(2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Saw these a couple times in the test, could we maybe use a more deterministic method to avoid waiting too long/too little if the system resolves earlier/later? Maybe a polling loop or kubectl command checking the state of what we are waiting for.

logging.info("Provisioning... %d/%d (%.0f%%)", running, batch_size, pct)
if running >= batch_size:
break
time.sleep(3)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since we have a configurable poll_interval that is used during the deletion loop on line 258, should we replace this hardcoded time.sleep(3) with time.sleep(poll_interval) for consistency?

# Pods we never saw disappear (stuck) get the full drain time
for pn in pod_names_before:
if pn not in pod_gone_times:
pod_gone_times[pn] = total_drain_time

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 there a way we are differentiating pods in the edge case that take the whole drain time to successfully delete vs pods that are stuck and are assigned the same drain time? Maybe we could track a count of stuck pods and push it through as an additional metric (like k8s_deletion_stuck_pods_count) so we can separate that?


ip_after = _CountAllocatedIPs(ns, label)
deletion_rate = (
(len(pod_names_before) / total_drain_time) if total_drain_time > 0 else 0

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 pods are left stuck, when we use len(pod_names_before) will it assume all pods were successfully deleted and inflate the deletion_rate? Since we are already tracking the exact number of deleted pods inside the loop on line 244, could we use the deleted variable as the numerator here?

provision_start = time.monotonic()
_PatchReplicas(ns, warmpool_name, batch_size)

deadline = time.time() + provision_timeout

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 stick to time.monotonic() rather than using and comparing different measures? Since time.time() could be affected by system clock adjustments, it could theoretically make the timeout weird.

deadline = t_scale + threshold_s
first_pod_time = None

while time.time() < deadline:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same question as before regarding monotonic() vs time()

@pmandewalkar pmandewalkar 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.

Left a few comments regarding clock and hardcoded sleeps.

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