Skip to content

feat(orchestrator): improve concurrent benchmark tracing and enable huge pages#2327

Merged
arkamar merged 5 commits intomainfrom
experiment/sbx-concurency
Apr 10, 2026
Merged

feat(orchestrator): improve concurrent benchmark tracing and enable huge pages#2327
arkamar merged 5 commits intomainfrom
experiment/sbx-concurency

Conversation

@arkamar
Copy link
Copy Markdown
Contributor

@arkamar arkamar commented Apr 8, 2026

While investigating concurrent sandbox creation performance, I found
that traces were missing key information — there was no way to filter
spans by concurrency level, and the biggest bottleneck inside resume-fc
was invisible in traces. I also enabled huge pages by default in the
benchmark to match production.

To fix the tracing gaps, I added concurrency and sandbox.index
attributes to benchmark spans for filtering in Grafana, and two new
spans in resume-fc (wait-uffd-socket and wait-rootfs-path) that
make the parallel waits before snapshot loading visible.
wait-rootfs-path turned out to be the primary bottleneck, growing
proportionally with concurrency due to kernel-level serialization in
nbdnl.Connect().

arkamar added 3 commits April 8, 2026 12:11
…rk spans

Add concurrency level, sandbox index, and sandbox ID attributes to the
bench-resume span so traces can be filtered by concurrency level in
Grafana/Tempo (e.g. {span.concurrency=5}).
Production uses huge pages, so the benchmark should too. Disable with
DISABLE_HUGE_PAGES=true for comparison. Uses a separate build ID per
mode to avoid cache collisions.
…ume-fc

During concurrent sandbox creation, resume-fc blocks on several
parallel waits before it can load the snapshot. These waits were
previously invisible — only covered by point-in-time ReportEvent
calls that do not capture duration.

Adding duration spans makes them visible as bars in the Grafana
waterfall view. This is important because wait-rootfs-path turned out to
be the primary bottleneck, growing significantly as more sandboxes are
created simultaneously.
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 8, 2026

PR Summary

Low Risk
Primarily adds OpenTelemetry spans/attributes and tweaks benchmark configuration; no production control flow changes beyond passing derived contexts into existing waits, so functional risk is low.

Overview
Improves observability of concurrent sandbox resume by adding per-goroutine bench-resume spans tagged with concurrency, sandbox.index, and sandbox.id, and by instrumenting resume-fc with new spans around waiting for the UFFD socket and resolving/symlinking the rootfs path. The concurrent resume benchmark now defaults to huge pages via a separate build ID, with an opt-out via DISABLE_HUGE_PAGES.

Reviewed by Cursor Bugbot for commit 621d261. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

(This was a test - please disregard)

@linear
Copy link
Copy Markdown

linear bot commented Apr 8, 2026

@arkamar arkamar marked this pull request as ready for review April 8, 2026 14:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1d48b0bc1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@arkamar arkamar marked this pull request as draft April 8, 2026 15:03
Use strconv.ParseBool so that common boolean env values like 1, TRUE,
or True are accepted, not just the exact string "true".
@arkamar arkamar marked this pull request as ready for review April 8, 2026 15:32
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b82e6e5f88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jakubno jakubno assigned jakubno and unassigned sitole Apr 10, 2026
Co-authored-by: Jakub Novák <jakub@e2b.dev>
@arkamar arkamar merged commit 49b8f16 into main Apr 10, 2026
81 of 82 checks passed
@arkamar arkamar deleted the experiment/sbx-concurency branch April 10, 2026 09:39
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