Skip to content

perf(sandbox): optimize virtual config delivery and benchmark mediated I/O - #5687

Draft
drew wants to merge 4 commits into
mainfrom
drew/compatible-config-performance
Draft

drew wants to merge 4 commits into
mainfrom
drew/compatible-config-performance

Conversation

@drew

@drew drew commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prepare sealed provider-file backing when configs are published, reuse unchanged revisions, and keep ordinary file-open classification to an exact six-byte read. Preserve independent read-only file offsets, atomic publications, seccomp notification, Landlock, and capability-free workloads.

This is a draft performance checkpoint: ARM64 measurements show lower managed-config median latency at low concurrency and a significant unresolved regression under contention.

Stack: this PR (base main) → #5686. Cedar and development-build commits are excluded. Benchmark artifacts and the Docker benchmark runner are excluded from this PR; the standalone seccomp harness remains. Historical measurements describe the original checkpoint, not this main-based port.

Related Issue

Maintainer-requested performance investigation. The author has verified repository ADMIN access and uses the current AGENTS.md exception for PRs without an issue.

Changes

  • Cache one sealed memfd per changed provider-file revision, retain only a read-only anchor, reopen independently for each caller, and publish complete generations atomically. Preserve provider limits and old-descriptor lifetime across update and detach.
  • Reject ordinary paths after an exact six-byte classification read; fully copy candidate paths before serving them and leave continued opens to kernel and Landlock enforcement.
  • Retain scalar socket-option fast paths, descriptor headroom checks, single-copy socket-address handling, and bounded blocking-connect workers.
  • Extend the standalone seccomp attribution harness and update runtime and troubleshooting documentation. Keep focused regression tests for publication, descriptor lifetime, syscall behavior, and resource bounds.

Release Notes

Testing

  • Unit tests added/updated and port validated
  • Docker E2E coverage exercised
  • Performance regression and review findings resolved

Validation of the sealed-memfd implementation on Linux ARM64:

  • Sandbox library with perf-harness: 362 passed, 0 failed.
  • Docker driver library: 153 passed, 2 ignored.
  • Compile checks cover sandbox default/perf builds and all four compute drivers plus the shared backend. The drivers and backend have no diff against main.
  • Docker E2E: 5 passed across provider update/detach, policy activation, and host gateway aliases, using fresh gateway, supervisor, and production sandbox builds.
  • Rust formatting, Markdown lint, and strict scoped Clippy pass with -D warnings.
  • GNU control-plane and static musl runtime release builds pass.

Outstanding findings:

  • At one thread, paired managed-config p50 improved 33.3% for 4 KiB and 78.0% for 64 KiB. At 16 threads those medians regressed 185.4% and 24.8%, respectively. The pinned 4 KiB follow-up still showed p99 up 292.1% and throughput down 31.3%; the cause is unproven.
  • The sockaddr boundary test assumes 4 KiB pages and fails when the supported /proc/<tid>/mem fallback is forced. The diagnostic failure was reproduced during the investigation.
  • Benchmark byte throughput over-reports reads from provider files shorter than the requested 64 bytes. The 4 KiB/64 KiB matrix is unaffected.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture and troubleshooting docs updated

@copy-pr-bot

copy-pr-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 18, 2026
drew added 2 commits November 17, 2026 20:21
Cache sealed provider revisions with independent read-only descriptions and simplify open classification while retaining seccomp and Landlock. Make the native provider-store experiment an explicit build opt-in. Preserve socket fast paths, bounded connect workers, paired benchmarks, raw measurements, filesystem research, and a cross-machine handoff with the pre-cache baseline.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew
drew force-pushed the drew/compatible-config-performance branch from 3f3ac0f to 23447e5 Compare November 18, 2026 04:31
@drew
drew changed the base branch from drew/cedar/dev-builds to main November 18, 2026 04:31
@copy-pr-bot

copy-pr-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

Maintainer list change

Gains approval rights:

Confirm every change is intended. Anyone listed here can single-handedly satisfy OpenShell / Maintainer Approval.

drew added 2 commits November 17, 2026 20:41
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>

This branch has not been deployed

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

Labels

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant