Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Restrict the maximum number of open HTTP RPC requests #9431

Merged
merged 5 commits into from
Aug 25, 2020

Conversation

vzqzhang
Copy link
Contributor

@vzqzhang vzqzhang commented Aug 24, 2020

Change Description

Added a new option for http-plugin : http-max-in-flight-requests. It restricts the maximum requests the flight can hold if --http-max-in-flight-requests = positive number. If the limit exceeds, it sends a 429 error to the client. if --http-max-in-flight-requests = -1, there is no limit so the feature is turned off. It protects non-producing nodeos against the flood of requests when it cannot get new blocks.

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Added a new http_plugin option --http-max-in-flight-requests. "--http-max-in-flight-requests = positive number" sets the limit of requests that the flight can hold. If the limit is exceeded, a 429 error is sent to the client. if --http-max-in-flight-requests = -1, the feature is turned off. The feature is turned off in default. The doc is: "Maximum number of requests http_plugin should use for processing http requests. 429 error response when exceeded."

A change is made for the http_plugin option http-max-bytes-in-flight-mb. When the limit is exceeded, the error coode is 429, instead of 503. The new doc is: "Maximum size in megabytes http_plugin should use for processing http requests. 429 error response when exceeded."

@vzqzhang vzqzhang requested a review from b1bart August 24, 2020 14:51
plugins/http_plugin/http_plugin.cpp Outdated Show resolved Hide resolved
plugins/http_plugin/http_plugin.cpp Outdated Show resolved Hide resolved
plugins/http_plugin/http_plugin.cpp Outdated Show resolved Hide resolved
plugins/http_plugin/http_plugin.cpp Outdated Show resolved Hide resolved
plugins/http_plugin/http_plugin.cpp Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants