From b52324cbf47a10ba6ad52af2ad4bbf0523171fbb Mon Sep 17 00:00:00 2001 From: Byron Gravenorst <50852695+bgravenorst@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:03:41 +1000 Subject: [PATCH] Add RPC batch size CLI option (#1277) * Add RPC batch size CLI option. Signed-off-by: bgravenorst * Minor typo. Signed-off-by: bgravenorst * Minor typo. Signed-off-by: bgravenorst --------- Signed-off-by: bgravenorst --- .../how-to/use-besu-api/json-rpc.md | 6 ++-- docs/public-networks/reference/cli/options.md | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/public-networks/how-to/use-besu-api/json-rpc.md b/docs/public-networks/how-to/use-besu-api/json-rpc.md index 175558d4496..9790e8151e1 100644 --- a/docs/public-networks/how-to/use-besu-api/json-rpc.md +++ b/docs/public-networks/how-to/use-besu-api/json-rpc.md @@ -96,8 +96,10 @@ To make RPC requests over HTTP, you can use [`curl`](https://curl.haxx.se/downlo } ``` -You can use `curl` to make multiple RPC requests over HTTP at the same time. -Send the requests as an array, and receive an array of responses. +You can use `curl` to make multiple RPC requests (batch requests) over HTTP at the same time. +Send the requests as an array, and receive an array of responses. The default number of allowed requests +in a RPC batch request is `1024`. Use the [`--rpc-http-max-batch-size`](../../reference/cli/options.md#rpc-http-max-batch-size) +command line option to update the default value. !!! example diff --git a/docs/public-networks/reference/cli/options.md b/docs/public-networks/reference/cli/options.md index c628c99db8d..55004341108 100644 --- a/docs/public-networks/reference/cli/options.md +++ b/docs/public-networks/reference/cli/options.md @@ -2491,6 +2491,35 @@ To allow remote connections, set to `0.0.0.0`. The maximum number of allowed HTTP JSON-RPC connections. Once this limit is reached, incoming connections are rejected. The default is 80. +### `rpc-http-max-batch-size` + +=== "Syntax" + + ```bash + --rpc-http-max-batch-size= + ``` + +=== "Example" + + ```bash + --rpc-http-max-batch-size=1200 + ``` + +=== "Environment variable" + + ```bash + BESU_RPC_HTTP_MAX_BATCH_SIZE=1200 + ``` + +=== "Configuration file" + + ```toml + rpc-http-max-batch-size=1200 + ``` + +The maximum number of allowed requests in a [RPC batch request](../../how-to/use-besu-api/json-rpc.md#http). +The default limit is `1024`, and `-1` specifies no limit. + ### `rpc-http-port` === "Syntax"