Bitcoin Forum
April 20, 2024, 12:17:39 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Maximum number of connections in bitcoin client  (Read 8548 times)
o (OP)
Member
**
Offline Offline

Activity: 76
Merit: 10


View Profile
November 24, 2011, 02:44:46 PM
 #1

I have tried to see how many active client nodes in the network. By running it for few days, the maximum number of connections I get is around 900.

So is it truely the size of bitcoin network at any moment? It is a bit weak in my opinion, isn't it?
1713572259
Hero Member
*
Offline Offline

Posts: 1713572259

View Profile Personal Message (Offline)

Ignore
1713572259
Reply with quote  #2

1713572259
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713572259
Hero Member
*
Offline Offline

Posts: 1713572259

View Profile Personal Message (Offline)

Ignore
1713572259
Reply with quote  #2

1713572259
Report to moderator
slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
November 24, 2011, 02:50:17 PM
 #2

Not every client is running on public port and not every client is willing to talk with you when you'll try to connect them. For example my pool server is rejecting new connections when it reaches some number to prevent overloading.

Steve
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1007



View Profile WWW
November 24, 2011, 02:51:01 PM
 #3

900!  The most I've ever seen is around 150 and that's after running for several weeks (and usually it hovers around 100).  What version are you running?  Is there an option to increase the number of connections it tries to maintain?

(gasteve on IRC) Does your website accept cash? https://bitpay.com
slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
November 24, 2011, 02:53:28 PM
 #4

net.cpp, version 0.3.24:
Code:
if (nInbound >= GetArg("-maxconnections", 125) - MAX_OUTBOUND_CONNECTIONS)
       closesocket(hSocket);

* yes, there's -maxconnection switch so user can adjust how many connections he want to keep
* when this number is reached, new connections are dropped

o (OP)
Member
**
Offline Offline

Activity: 76
Merit: 10


View Profile
November 24, 2011, 03:12:55 PM
 #5

I have tried to see how many active client nodes in the network. By running it for few days, the maximum number of connections I get is around 900.

So is it truely the size of bitcoin network at any moment? It is a bit weak in my opinion, isn't it?

A pool certainly have many connections so you set a limit yourself, but I would consider most client is the standard version that does not reach the limit.

EDIT: BTW, what is the normal maximum number of connections you get now and at the time you start the pool.

net.cpp, version 0.3.24:
Code:
if (nInbound >= GetArg("-maxconnections", 125) - MAX_OUTBOUND_CONNECTIONS)
       closesocket(hSocket);

* yes, there's -maxconnection switch so user can adjust how many connections he want to keep
* when this number is reached, new connections are dropped

Yes, both maxconnections and MAX_OUTBOUND_CONNECTIONS needs to set to a very large number.
P4man
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500



View Profile
November 24, 2011, 03:19:36 PM
 #6

Hmm..? Ive never seen more than 8 connections. I am behind 2 NATs though, I assume that has something to do with it..

slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
November 24, 2011, 03:23:38 PM
 #7

EDIT: BTW, what is the normal maximum number of connections you get now and at the time you start the pool.

Pool has only custom number in MAX_OUTBOUND_CONNECTION to make building p2p network faster after startup, but I'm using default maxconnections. As pool node is (obviously) permanent and almost without downtime, I have 125 connections all the time. After I moved pool to another IP, pool reached outbound connections pretty easily (in few hours), but it took few days until clients resolved new IP and 125 slots got filled.

Afaik, number of actively listening nodes is decreasing, but there are still thousands of them. Unfortunately I don't remember site which is crawling them and make graphs with timeline.

slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
November 24, 2011, 03:24:25 PM
 #8

Hmm..? Ive never seen more than 8 connections. I am behind 2 NATs though, I assume that has something to do with it..

Yes, MAX_OUTBOUND_CONNECTIONS in default client is 8 and because you're behind nat, other clients cannot open connection to you. However 8 connections is enough for normal client node.

piuk
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1005



View Profile WWW
November 24, 2011, 03:27:06 PM
 #9

The standard bitcoin client will likely not connect to over 1000 nodes as it's limited by select()'s fd_set size of 1024. I'm not sure if this is true of windows. My client, which uses kqueue, has connected to over 5000 nodes at once.

o (OP)
Member
**
Offline Offline

Activity: 76
Merit: 10


View Profile
November 24, 2011, 03:40:36 PM
 #10

Afaik, number of actively listening nodes is decreasing, but there are still thousands of them. Unfortunately I don't remember site which is crawling them and make graphs with timeline.

This one? http://bitcoinstatus.rowit.co.uk/

Hmm..? Ive never seen more than 8 connections. I am behind 2 NATs though, I assume that has something to do with it..

Yes, MAX_OUTBOUND_CONNECTIONS in default client is 8 and because you're behind nat, other clients cannot open connection to you. However 8 connections is enough for normal client node.

8 connections is certainly more than enough if it is completely random, but it is a bit small in real case I think.

The standard bitcoin client will likely not connect to over 1000 nodes as it's limited by select()'s fd_set size of 1024. I'm not sure if this is true of windows. My client, which uses kqueue, has connected to over 5000 nodes at once.

I think it is the right reason since my connection never over 1000, I have suspected that there is some 1024 but none of it in the source codes. So it should be the system limit. It is build in ubuntu.
slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
November 24, 2011, 03:42:11 PM
Last edit: November 24, 2011, 03:56:05 PM by slush
 #11


Exactly. There's drop from ~60k nodes (all time history of charts) to ~40k nodes. Many people are saying that it's an indicator for bitcoin population and decreasing nodes == bitcoin rejection.

OT: I must say that I don't think so. From my neighborhood I'm the only one person who's using official client on my personal computer and it's mostly just because it's configured as "trusted node" for pool :-). Other people around me are starting to use web wallets because they have many benefits for common users (like instant access from everywhere) and also because maintaining full blockchain on personal computers and notebooks is simply annoying. Thanks to this, I believe that although count of bitcoin nodes is slightly decreasing, bitcoin population is still increasing, they just don't run official client, thus they're off the statistics.

Totally OT: As maintaining blockchain is going to be harder and harder, I believe that people will switch to lightweight clients like electrum - clients which don't handle even blockheaders, just private keys. It's great way to be almost completely safe (in contrary of web wallets) and not burn own computer while receiving transaction only once a week.

bitpop
Legendary
*
Offline Offline

Activity: 2912
Merit: 1060



View Profile WWW
January 04, 2014, 05:02:15 PM
 #12

I keep seeing two numbers, is it 8 or 125?

ajas
Member
**
Offline Offline

Activity: 130
Merit: 58


View Profile
January 04, 2014, 09:22:58 PM
 #13


Exactly. There's drop from ~60k nodes (all time history of charts) to ~40k nodes. Many people are saying that it's an indicator for bitcoin population and decreasing nodes == bitcoin rejection.


As far as I see bitcoinstatus.rowit.co.uk is not updated any more.
The graphs last until October. (I dont know which year).
Shawshank
Legendary
*
Offline Offline

Activity: 1623
Merit: 1608



View Profile
January 04, 2014, 09:34:29 PM
 #14

I keep seeing two numbers, is it 8 or 125?

By default, if the value on the bottom right side of Bitcoin-Qt says "8 connections to the Bitcoin network", you are most likely behind a firewall and you are not accepting incoming connections. In that case, you are acting like a leech and you are just putting burden on the network.

Normally, if the message at the bottom right side is something higher than 8 connections, you are contributing to the network by accepting incoming connections.

I keep a Bitcoin-Qt node running non-stop and I have never reached 90 active connections. Apart from the configuration, I believe it also depends on the upstream speed of your network and the processing capability of your machine.


Lightning Address: shawshank@getalby.com
bitpop
Legendary
*
Offline Offline

Activity: 2912
Merit: 1060



View Profile WWW
January 05, 2014, 04:31:31 AM
 #15

Sweet I'm trying to get 1000 connections

spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
January 06, 2014, 03:09:00 PM
 #16

Checkout: http://getaddr.bitnodes.io/

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
bitpop
Legendary
*
Offline Offline

Activity: 2912
Merit: 1060



View Profile WWW
January 06, 2014, 04:45:00 PM
 #17

I just launched nodes in nyc and ams
Sfo and Asia coming

doolittle
Full Member
***
Offline Offline

Activity: 340
Merit: 101


View Profile
January 20, 2014, 02:37:10 PM
 #18

How is it possible to increase max_outbound_connections?
I want to increase the speed of the blockchain download.
So far I only have 8. BTW: can I also use the same options with dogecoin-client?
Looks exactly the same as Satoshi-Client.
Dr.Bob
Sr. Member
****
Offline Offline

Activity: 306
Merit: 250


View Profile
March 25, 2014, 11:03:26 AM
 #19

Code:
net.cpp
Line 40 > static const int MAX_OUTBOUND_CONNECTIONS = 8;

https://github.com/bitcoin/bitcoin/blob/fc5d85c4bbb5fd5964117d4faf698ef2bf4ec634/src/net.cpp#L40

Maybe it helps  Grin

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!