Skip to content

Commit

Permalink
[Hotfix] Fix default http max connections value for RPC servers (#92) (
Browse files Browse the repository at this point in the history
…#96) (#100)

[Hotfix] Fix default http max connections value for RPC servers (#90)

Fix default http max connections value for RPC servers
  • Loading branch information
dmitrylavrenov authored Dec 19, 2023
1 parent 0168cdb commit 3a42ab7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/rpc-servers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub const RPC_MAX_PAYLOAD_DEFAULT: usize = 15 * MEGABYTE;
/// Default maximum number of connections for WS RPC servers.
const WS_MAX_CONNECTIONS: usize = 100;

/// Default maximum number of connections for HTTP RPC servers.
const HTTP_MAX_CONNECTIONS: u32 = 16000;

/// Default maximum number subscriptions per connection for WS RPC servers.
const WS_MAX_SUBS_PER_CONN: usize = 1024;

Expand Down Expand Up @@ -102,6 +105,7 @@ pub async fn start_http<M: Send + Sync + 'static>(
let builder = ServerBuilder::new()
.max_request_body_size(max_payload_in)
.max_response_body_size(max_payload_out)
.max_connections(HTTP_MAX_CONNECTIONS)
.set_host_filtering(host_filter)
.set_middleware(middleware)
.custom_tokio_runtime(rt)
Expand Down

0 comments on commit 3a42ab7

Please sign in to comment.