mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
config: increase max_connections default from 2000 to 4096
Increases connection limit across all configuration sources: - src/config.rs: default_value_t = 4096 - docs/reference/configuration.md: updated default and examples - nix/module.nix: maxConnections default = 4096 - .env.example: updated default and comment This allows the relay to handle more concurrent connections and reduces the likelihood of connection exhaustion under normal load. The previous limit of 2000 was too conservative for production deployments.
This commit is contained in:
+2
-2
@@ -286,5 +286,5 @@
|
||||
# Maximum total connections to the relay
|
||||
# Prevents connection exhaustion DoS attacks
|
||||
# CLI: --max-connections <count>
|
||||
# Default: 500
|
||||
# NGIT_MAX_CONNECTIONS=500
|
||||
# Default: 4096
|
||||
# NGIT_MAX_CONNECTIONS=4096
|
||||
@@ -931,17 +931,17 @@ Event blacklist does **not** affect NIP-11 metadata:
|
||||
|
||||
**Description:** Maximum total connections to the relay. Prevents connection exhaustion DoS attacks.
|
||||
**Type:** Integer
|
||||
**Default:** `500`
|
||||
**Default:** `4096`
|
||||
**Required:** No
|
||||
|
||||
**Examples:**
|
||||
|
||||
```bash
|
||||
# Default: 500 connections
|
||||
NGIT_MAX_CONNECTIONS=500
|
||||
# Default: 4096 connections
|
||||
NGIT_MAX_CONNECTIONS=4096
|
||||
|
||||
# Higher limit for large public relay
|
||||
NGIT_MAX_CONNECTIONS=1000
|
||||
NGIT_MAX_CONNECTIONS=8000
|
||||
|
||||
# Lower limit for private relay
|
||||
NGIT_MAX_CONNECTIONS=100
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ let
|
||||
|
||||
maxConnections = mkOption {
|
||||
type = types.int;
|
||||
default = 500;
|
||||
default = 4096;
|
||||
description = "Maximum total connections to the relay";
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -470,9 +470,9 @@ pub struct Config {
|
||||
#[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")]
|
||||
pub event_blacklist: String,
|
||||
|
||||
/// Maximum total connections to the relay (default: 500)
|
||||
/// Maximum total connections to the relay (default: 4096)
|
||||
/// Prevents connection exhaustion DoS attacks
|
||||
#[arg(long, env = "NGIT_MAX_CONNECTIONS", default_value_t = 500)]
|
||||
#[arg(long, env = "NGIT_MAX_CONNECTIONS", default_value_t = 4096)]
|
||||
pub max_connections: usize,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user