Author

Topic: max connections (Read 261 times)

legendary
Activity: 1583
Merit: 1276
Heisenberg Design Services
July 10, 2019, 01:24:26 AM
#6
Maximum number of connections in bitcoin node was the topic which kept me rumbling over a few months back. There is some really good discussion about max connection in this topic : https://bitcointalksearch.org/topic/number-of-connections-5109163

If you set -maxconnections=20 your node is connected to 12 incoming connections and 8 outgoing connections. The maxconnections has nothing to do with outgoing connections and it just controls how many other nodes connect to you. If you leave the -maxconnections undefined your node will allow atmost 117 other nodes to connect to you by default. That's the default limit specified in the code as TheWolf666 mentioned above. And in order for you to get the 117 incoming it takes time for other nodes to connect to you.

If you want a lot of connection you can specify maxconnections=1000 in bitcoin.conf or in command line with -maxconnections=1000.

For most of the time, the -maxconnections will probably drop to 845 connections or similar if we are specifying -maxconnections=1000 based on your file descriptors. We can change the configuration and make the node to connect to more than 845 too but that would be too bad for the PC and I recommend not trying that out.

See this

Leaving it undefined (commented out) bitcoind outputs (and logs) this:
Using at most 125 automatic connections (1024 file descriptors available)

If 1 (either bitcoin.conf or -maxconnections=1, it shows this:
Using at most 1 automatic connections (1024 file descriptors available)

Using "2000" like the OP wanted, it shows this:
Using at most 865 automatic connections (1024 file descriptors available)
full member
Activity: 615
Merit: 154
CEO of Metaisland.gg and W.O.K Corp
July 08, 2019, 12:46:49 PM
#5
i have 2 full nodes running on my lan. on one max connections are set to 20.  the other is unlimited.  for some reason i cant get more than 20 on the one that is set to unlimited. is it just coincidence that the number of connections on the unlimited config happens to be equal to what i set the max connections to on the other? 

By default Unlimited = 125
But Bitcoin evaluates your hardware and set a limit by itself.

Here is the code

Code:
/** The maximum number of peer connections to maintain. */
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;

If you want a lot of connection you can specify maxconnections=1000 in bitcoin.conf or in command line with -maxconnections=1000

If you specify a very high number, Bitcoin will calculate the most your hardware can handle. It will say nothing if your hardware can accept the number you entered, but if this number is higher than the most Bitcoin evaluated, you will get a popup with a warning telling you what maximum Bitcoin can set for your hardware.
jr. member
Activity: 45
Merit: 22
June 29, 2019, 04:16:58 PM
#4
In first place, how do you manage to configure your client to allow unlimited connection? AFAIK there's no such configuration, Do you simply set very big value on -maxconnections command?

Anyway, it sounds like a coincidence & i think you should let it run for a while and see if there's a moment where there are more than 20 connection.

sorry, didn't mean unlimited.  i just meant i didn't set a maximum.

i'll keep watching it, but it's been a few days already.



jr. member
Activity: 45
Merit: 22
June 29, 2019, 02:49:46 PM
#3
the node set with max connections= 20 is using port 8333
the other node with unlimited connections is using 8334

legendary
Activity: 2954
Merit: 4158
June 29, 2019, 02:35:35 PM
#2
Are you using the same ports (8333) on both of the clients?

This is just a hypothesis since I've never tried it before: If you're running them on the same port with the same public IP, both of your nodes are receiving the same information from the same 12 incoming nodes. Since the information are mirrored to both of the nodes, it is likely that there is a conflict and your other node is rejecting the connection from the extra nodes. Try checking the IPs connected to each of your nodes.

Nevermind, I thought about it further and realised that the nature of TCP wouldn't let 2 programs to be binded to the same port and routers wouldn't have allowed this with port forwarding anyways.
jr. member
Activity: 45
Merit: 22
June 28, 2019, 10:45:08 PM
#1
i have 2 full nodes running on my lan. on one max connections are set to 20.  the other is unlimited.  for some reason i cant get more than 20 on the one that is set to unlimited. is it just coincidence that the number of connections on the unlimited config happens to be equal to what i set the max connections to on the other?



 
Jump to: