Skip to content

perf: reuse synchronous request VMs - #2

Merged
fffonion merged 1 commit into
masterfrom
perf/sync-request-vm-pool
Sep 20, 2026
Merged

fffonion merged 1 commit into
masterfrom
perf/sync-request-vm-pool

Conversation

@fffonion

Copy link
Copy Markdown
Contributor

Summary

  • add a worker-local pool for synchronous request-aware VMs so host modules are bound once and reused
  • classify async, timer, Cosocket, standard IO/HTTP, and SQLite programs out of the reuse path
  • reset halted VMs, clear per-request bridge/print state, and discard failed, cancelled, or non-resettable VMs
  • isolate reusable VMs by program identity, NGINX phase, and complete host policy

Performance

Five rotated JIT-off key-auth rounds with one worker, wrk -t4 -c128, 10-second warm-up, and 15-second measurement:

  • optimized median: 10,348.75 requests/s
  • baseline control median: 6,709.51 requests/s
  • paired optimized/control median: 147.15% (+47.15%)
  • NGINX median: 16,989.32 requests/s
  • zero socket errors, zero non-success responses, and no worker replacement

Authentication values were temporary and are omitted.

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • 198 serial library tests
  • 34 access configuration tests
  • real NGINX: key-auth 39, async 36, access 51, content 41
  • release library build
  • Grok 4.6 task review, scoped re-review, and exact-commit final review: clean

@fffonion
fffonion merged commit 3d52168 into master Sep 20, 2026
1 check passed
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.

1 participant