-
Notifications
You must be signed in to change notification settings - Fork 420
feat: per worker max_threads #1962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # worker.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces per-worker max_threads configuration to allow setting absolute thread limits for individual workers, preventing them from consuming all available threads during scaling. This is useful for isolating worker pools, managing extensions, and running multiple domains with separate thread limits.
- Adds
maxThreadsfield to worker configuration and corresponding validation logic - Updates scaling logic to respect per-worker thread limits
- Adds comprehensive test coverage for thread calculation scenarios with worker-specific limits
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| worker.go | Adds maxThreads field to worker struct and implements logic to prevent scaling beyond per-worker limit |
| scaling.go | Updates upscaling logic to check and enforce per-worker max thread limits |
| phpmainthread_test.go | Adds test cases for thread calculation with per-worker max_threads configurations |
| options.go | Adds WithWorkerMaxThreads option function for configuring worker max threads |
| frankenphp.go | Implements validation and calculation logic for worker max_threads in relation to global limits |
| caddy/workerconfig.go | Adds Caddyfile parsing support for max_threads directive in worker configuration |
| caddy/app.go | Wires up worker max_threads configuration to FrankenPHP options |
| caddy/admin_test.go | Updates test to verify auto-scaling respects per-worker max_threads limits |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could you please rebase @AlliBalliBaba? |
# Conflicts: # worker.go
|
Thanks! |
Currently all workers compete for all threads on scaling, this PR allows setting an absolute limit per-worker.
Can be useful: