Support for configuring max. concurrent requests and request body buffer - #505
Merged
Conversation
Contributor
|
Looking good to me- happy to merge if you are fine with this PR? |
…rent-requests" is set
Contributor
Author
|
We can discuss further on the mentioned 3 options regarding the default values, if you'd like. I went ahead and commited changes to go with the option (3) - add default value to the other parameter if only one is set. If this is OK with you, you can go ahead with the merge. |
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.
This PR adds configuration options for setting the parameters of
LimitConcurrentRequestsMiddlewareandRequestBodyBufferMiddlewaremiddlewares in ReactPHP server.This allows us to handle request bodies larger than 64K after the 2.1.0 release that includes reactphp/http#371.
This PR is currently incomplete due to how we handle default values and I cannot really decide on the options below:
Keep the default ReactPHP server behavior by default and manually configure these two middlewares only when both of the new configuration options are present.
Remove the default behavior (HttpServer initialization without these middlewares) and configure default values in PHP-PM. We could set them to 1024 and 64K. This is probably the most clear way of configuring them from the PHP-PM perspective, but it does stop the default ReactPHP calculation from working (the way it calculates these values is described here - https://github.com/reactphp/http#server).
Keep the current PR code and only add default values in HttpServer initialization when only one of the two options is present. Maybe just use 1024 and 64K again for the default values, but only apply them to the undefined configuration parameter. E.g.:
Also, the naming of these configuration options and the descriptions can be changed. Any suggestions are welcome.