From 3f5600638bc07473d95cb8e03c2a1833699a0c40 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Sun, 14 Jul 2024 12:38:44 +1200 Subject: [PATCH] Increase default rate limits to 1MB per second, 16MB burst --- contrib/chorus.toml | 13 +++++++------ docs/CONFIG.md | 9 +++++---- src/config.rs | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/contrib/chorus.toml b/contrib/chorus.toml index 9b9b017..b548b1a 100644 --- a/contrib/chorus.toml +++ b/contrib/chorus.toml @@ -272,12 +272,13 @@ timeout_seconds = 60 max_connections_per_ip = 5 -# The maximum rate (excluding bursts) of data that will be accepted over a websocket connection -# (per connection). Beyond this rate (in a sustained way) the connection will be closed. +# The maximum rate (excluding bursts) of data that will be transmitted over a websocket connection +# (both directions, per connection). Beyond this rate (in a sustained way) the connection will be +# closed. # -# Default is 131072 bytes per second. +# Default is 1024576 bytes per second. # -throttling_bytes_per_second = 131072 +throttling_bytes_per_second = 1024576 # The allowable bursts of data beyond the normal rate. @@ -287,6 +288,6 @@ throttling_bytes_per_second = 131072 # second. If that bucket doesn't have enough, the burst won't be allowed and the connection # will be closed. # -# Default is 4194304 bytes. +# Default is 16777216 bytes. # -throttling_burst = 4194304 +throttling_burst = 16777216 diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 1924693..b66e4ef 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -237,10 +237,11 @@ Default is 5 ### throttling_bytes_per_second -The maximum rate (excluding bursts) of data that will be accepted over a websocket connection -(per connection). Beyond this rate (in a sustained way) the connection will be closed. +The maximum rate (excluding bursts) of data that will be transmitted over a websocket connection +(both directions, per connection). Beyond this rate (in a sustained way) the connection will be +closed. -Default is 131072 bytes per second. +Default is 1024576 bytes per second. ### throttling_burst @@ -251,4 +252,4 @@ As bytes are consumed the count goes down, but we refund throttling_bytes_per_se second. If that bucket doesn't have enough, the burst won't be allowed and the connection will be closed. -Default is 4194304 bytes. +Default is 16777216 bytes. diff --git a/src/config.rs b/src/config.rs index 24b1ad0..33aacd4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -73,8 +73,8 @@ impl Default for FriendlyConfig { minimum_ban_seconds: 1, timeout_seconds: 60, max_connections_per_ip: 5, - throttling_bytes_per_second: 1024 * 128, - throttling_burst: 1024 * 1024 * 4, + throttling_bytes_per_second: 1024 * 1024, + throttling_burst: 1024 * 1024 * 16, } } }