Bitcoin Forum
June 06, 2024, 07:16:43 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BitCoin Node - maxconnections 873  (Read 660 times)
noalx (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
November 23, 2016, 09:13:46 PM
Merited by ABCbits (1)
 #1

Hi

I just wanted to increase the maxconnections of my Bitcoin Core Node (v0.13.1) to about 1000 to 2000 connections.

If i set maxconnections to 1000 i get the following error:
Quote
Reducing -maxconnections from %d to %d, because of system limitations.

Maxconnections is reduced to 873 connections. Why?
I also checked "RLIMIT_NOFILE" and it is far above 873 connections.

Is there another reason, why it is set to 873 connections?

Thank you for your help
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3416
Merit: 6675


Just writing some code


View Profile WWW
November 23, 2016, 09:25:15 PM
Merited by ABCbits (2)
 #2

RLIMIT_NOFILE is not related to this.

The limitation is defined here: https://github.com/bitcoin/bitcoin/blob/40022fe5f2b576d023fa260eb176bde6d0779330/src/init.cpp#L855

FD_SETSIZE is default 1024 (set by system). That is the absolute maximum number of file descriptors. MIN_CORE_FILEDESCRIPTORS is 150, and nBind is default 1. Thus you can only have 1024-1-150=873 connections.

noalx (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
November 23, 2016, 09:54:04 PM
 #3

RLIMIT_NOFILE is not related to this.

The limitation is defined here: https://github.com/bitcoin/bitcoin/blob/40022fe5f2b576d023fa260eb176bde6d0779330/src/init.cpp#L855

FD_SETSIZE is default 1024 (set by system). That is the absolute maximum number of file descriptors. MIN_CORE_FILEDESCRIPTORS is 150, and nBind is default 1. Thus you can only have 1024-1-150=873 connections.

Thank you.

Is there any reason, why FD_SETSIZE is set to 1024? Do i break something if i increase this?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3416
Merit: 6675


Just writing some code


View Profile WWW
November 23, 2016, 10:24:26 PM
 #4

Thank you.

Is there any reason, why FD_SETSIZE is set to 1024? Do i break something if i increase this?
FD_SETSIZE is set by the system. IIRC you can't change it.

cr1776
Legendary
*
Offline Offline

Activity: 4060
Merit: 1303


View Profile
November 23, 2016, 11:56:43 PM
 #5

RLIMIT_NOFILE is not related to this.

The limitation is defined here: https://github.com/bitcoin/bitcoin/blob/40022fe5f2b576d023fa260eb176bde6d0779330/src/init.cpp#L855

FD_SETSIZE is default 1024 (set by system). That is the absolute maximum number of file descriptors. MIN_CORE_FILEDESCRIPTORS is 150, and nBind is default 1. Thus you can only have 1024-1-150=873 connections.

Thank you.

Is there any reason, why FD_SETSIZE is set to 1024? Do i break something if i increase this?

Depending on the system you are using, you may be able to increase it.  E.g. In some versions of Linux, you could probably recompile the kernel etc with different parameters.  It has been 10+ years since I've looked at this, so I don't have specifics.
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!