Skip to content

fix(http): recycle Hyperloop B workers after bounded requests - #239

Merged
loks0n merged 2 commits into
mainfrom
codex/http-hyperloop-b-max-request
Sep 9, 2026
Merged

loks0n merged 2 commits into
mainfrom
codex/http-hyperloop-b-max-request

Conversation

@loks0n

@loks0n loks0n commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Hyperloop B currently leaves worker request lifetimes unlimited, allowing retained process memory to accumulate. Set max_request to 10,000 and retain Swoole's default max_request_grace of half that limit. The resulting randomized threshold of 10,001–15,000 requests spreads worker recycling. Comments explain that applications should tune the limit to memory growth and startup cost.

Validation:

  • bin/monorepo check http passed (Pint, PHPStan, Rector).
  • HTTP unit suite passed: 122 tests, 358 assertions; one existing Route::getMethod() deprecation.
  • Swoole 6.2.2 accepted the generated settings with no grace override in a runtime configuration check.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness, security, or repository-rule violations identified.

Summary

  • Sets max_request to 10,000 for Hyperloop B.
  • Relies on Swoole’s default grace interval to stagger worker recycling.
  • Documents the operational tradeoff between memory growth and worker startup cost.

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Benchmark results

http — Swoole modes (4 cores, 200 VUs, 20s/run)

workload mode req/s p95
ok a 14616.834958/s 30.02ms
ok b 15283.788427/s 28.9ms
io a 466.961273/s 604.97ms
io b 3344.893513/s 51.6ms
cpu a 3330.179583/s 168.29ms
cpu b 3138.229582/s 82.68ms

a = HYPERLOOP_A (process), b = HYPERLOOP_B (coroutine)

Shared CI runners — treat absolute numbers as rough, compare modes within a run. Commit dabfbd2.

@loks0n
loks0n merged commit 324066f into main Sep 9, 2026
7 checks 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