From 353ea4934dfd28f474111ef810a98dd7b5ea7a12 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Fri, 13 Jan 2023 12:31:55 -0500 Subject: [PATCH 1/2] network: increase max incoming connections limit --- config/localTemplate.go | 4 ++-- config/local_defaults.go | 2 +- installer/config.json.example | 2 +- test/testdata/configs/config-v27.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/localTemplate.go b/config/localTemplate.go index 4be9e300fe..985b622929 100644 --- a/config/localTemplate.go +++ b/config/localTemplate.go @@ -75,8 +75,8 @@ type Local struct { // IncomingConnectionsLimit specifies the max number of long-lived incoming // connections. 0 means no connections allowed. Must be non-negative. - // Estimating 5MB per incoming connection, 5MB*800 = 4GB - IncomingConnectionsLimit int `version[0]:"-1" version[1]:"10000" version[17]:"800"` + // Estimating 1.5MB per incoming connection, 1.5MB*2400 = 3.6GB + IncomingConnectionsLimit int `version[0]:"-1" version[1]:"10000" version[17]:"800" version[27]:"2400"` // BroadcastConnectionsLimit specifies the number of connections that // will receive broadcast (gossip) messages from this node. If the diff --git a/config/local_defaults.go b/config/local_defaults.go index b9a993631f..b695b5e770 100644 --- a/config/local_defaults.go +++ b/config/local_defaults.go @@ -80,7 +80,7 @@ var defaultLocal = Local{ ForceRelayMessages: false, GossipFanout: 4, HeartbeatUpdateInterval: 600, - IncomingConnectionsLimit: 800, + IncomingConnectionsLimit: 2400, IncomingMessageFilterBucketCount: 5, IncomingMessageFilterBucketSize: 512, IsIndexerActive: false, diff --git a/installer/config.json.example b/installer/config.json.example index 59150b031b..deb88cb497 100644 --- a/installer/config.json.example +++ b/installer/config.json.example @@ -59,7 +59,7 @@ "ForceRelayMessages": false, "GossipFanout": 4, "HeartbeatUpdateInterval": 600, - "IncomingConnectionsLimit": 800, + "IncomingConnectionsLimit": 2400, "IncomingMessageFilterBucketCount": 5, "IncomingMessageFilterBucketSize": 512, "IsIndexerActive": false, diff --git a/test/testdata/configs/config-v27.json b/test/testdata/configs/config-v27.json index 375c6f8712..725ce74dd1 100644 --- a/test/testdata/configs/config-v27.json +++ b/test/testdata/configs/config-v27.json @@ -60,7 +60,7 @@ "ForceRelayMessages": false, "GossipFanout": 4, "HeartbeatUpdateInterval": 600, - "IncomingConnectionsLimit": 800, + "IncomingConnectionsLimit": 2400, "IncomingMessageFilterBucketCount": 5, "IncomingMessageFilterBucketSize": 512, "IsIndexerActive": false, From 07552dbdb5590b9066afb8f66a7cd1fbadec60c1 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Fri, 13 Jan 2023 13:46:35 -0500 Subject: [PATCH 2/2] Decrease connections per ip addr limit as well --- config/localTemplate.go | 2 +- config/local_defaults.go | 2 +- installer/config.json.example | 2 +- test/testdata/configs/config-v27.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/localTemplate.go b/config/localTemplate.go index 985b622929..365b37b74b 100644 --- a/config/localTemplate.go +++ b/config/localTemplate.go @@ -59,7 +59,7 @@ type Local struct { // what we should tell people to connect to PublicAddress string `version[0]:""` - MaxConnectionsPerIP int `version[3]:"30"` + MaxConnectionsPerIP int `version[3]:"30" version[27]:"15"` // 0 == disable PeerPingPeriodSeconds int `version[0]:"0"` diff --git a/config/local_defaults.go b/config/local_defaults.go index b695b5e770..0c525505ef 100644 --- a/config/local_defaults.go +++ b/config/local_defaults.go @@ -92,7 +92,7 @@ var defaultLocal = Local{ MaxAPIResourcesPerAccount: 100000, MaxAcctLookback: 4, MaxCatchpointDownloadDuration: 7200000000000, - MaxConnectionsPerIP: 30, + MaxConnectionsPerIP: 15, MinCatchpointFileDownloadBytesPerSecond: 20480, NetAddress: "", NetworkMessageTraceServer: "", diff --git a/installer/config.json.example b/installer/config.json.example index deb88cb497..4e1192aa8f 100644 --- a/installer/config.json.example +++ b/installer/config.json.example @@ -71,7 +71,7 @@ "MaxAPIResourcesPerAccount": 100000, "MaxAcctLookback": 4, "MaxCatchpointDownloadDuration": 7200000000000, - "MaxConnectionsPerIP": 30, + "MaxConnectionsPerIP": 15, "MinCatchpointFileDownloadBytesPerSecond": 20480, "NetAddress": "", "NetworkMessageTraceServer": "", diff --git a/test/testdata/configs/config-v27.json b/test/testdata/configs/config-v27.json index 725ce74dd1..1881f6bcba 100644 --- a/test/testdata/configs/config-v27.json +++ b/test/testdata/configs/config-v27.json @@ -72,7 +72,7 @@ "MaxAPIBoxPerApplication": 100000, "MaxAPIResourcesPerAccount": 100000, "MaxCatchpointDownloadDuration": 7200000000000, - "MaxConnectionsPerIP": 30, + "MaxConnectionsPerIP": 15, "MinCatchpointFileDownloadBytesPerSecond": 20480, "NetAddress": "", "NetworkMessageTraceServer": "",