Conversation
alexandre-daubois
approved these changes
Nov 10, 2025
dunglas
requested changes
Nov 10, 2025
# Conflicts: # worker.go
dunglas
approved these changes
Nov 12, 2025
Contributor
There was a problem hiding this comment.
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.
Member
|
Could you please rebase @AlliBalliBaba? |
# Conflicts: # worker.go
dunglas
requested changes
Nov 18, 2025
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently all workers compete for all threads on scaling, this PR allows setting an absolute limit per-worker.
Can be useful: