BitcoinTalk

Feature Request: Limiting Connections

BitcoinTalk
#1
From:
lachesis
Subject:
Feature Request: Limiting Connections
Date:
I'd like to see an option (with an RPC interface as well) to limit the number of connections that a Bitcoin client accepts. My home client is connected to 70 different nodes and my poor wimpy router just can't keep up. It's starting to slow my network down, to the point where I'll need to force Bitcoin to ignore connection requests (with -connect=<a node>) if this keeps up.

A connection limiting option would be a great alternative.
BitcoinTalk
#2
From:
Vasiliev
Subject:
Re: Feature Request: Limiting Connections
Date:
Unforward port 8333 Tongue
It'll limit it to 15 and still work fine.
BitcoinTalk
#3
From:
lachesis
Subject:
Re: Feature Request: Limiting Connections
Date:
Alright. Thanks.

Would still be a nice feature. I don't mind people connecting to me to bootstrap or something, and I'd probably leave it at 40 rather than 15.
BitcoinTalk
#4
From:
BitcoinFX
Subject:
Re: Feature Request: Limiting Connections
Date:
Might I 2nd this request as a 'standard' GUI feature.

I've recently tested bitcoin through various socks proxies / providers and the ability to limit connections below 10 would be really useful.   
BitcoinTalk
#5
From:
satoshi
Subject:
Re: Feature Request: Limiting Connections
Date:
Thanks for the feedback on this.

One thing we could do is lower the outbound connections from 15 to 10 or maybe even 5.  The choice of 15 was arbitrary.  It just needs to be enough for redundancy and fast exponential propagation of messages.  10 would still be plenty.  5 should be fine.  10 is good as a nice round number so users can see that it stopped intentionally.

It would help to implement UPnP so there would be more inbound accepting nodes.  Your number of connections is the ratio of inbound accepting nodes to out-only times 15.  We need to encourage more people to accept inbound connections.

I will implement a feature to stop accepting inbound connections once you hit a certain number.

Which version are you running?

Anyone know how many connections typical P2P software like BitTorrent can get up to?

BitcoinTalk
#6
From:
laszlo
Subject:
Re: Feature Request: Limiting Connections
Date:
BitTorrent clients can do hundreds of connections easily - this is why they end up killing those little embedded routers.  It should be no problem for a regular IP router but the little embedded things are doing NAT so they're tracking state on all those connections and run out of memory.. also they're very slow SoC style computers so everything going through them suffers.

Torrent clients generally have options for configuring a global maximum number of connections, maximum inbound and maximum outbound connections.

I think it would be good to allow configuration of unlimited inbound/outbound connections for those who have the capability to do it, and provide a conservative default for those who are using NAT, tor, proxies, etc.
BitcoinTalk
#7
From:
satoshi
Subject:
Re: Feature Request: Limiting Connections
Date:
I reduced max outbound connections from 15 to 8 in RC4.

15 was way more than we needed for redundancy.  8 is still plenty of redundancy.

As the nodes upgrade to this version, this will cut in half the number of connections that inbound accepting nodes get.

If anyone wants more than 8 connections, they can open port 8333 on their firewall.