Bitcoin Forum
May 24, 2024, 03:13:16 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: maxconnections and memory usage  (Read 1404 times)
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 500



View Profile WWW
November 12, 2014, 01:25:49 PM
Last edit: November 12, 2014, 01:44:29 PM by tuaris
 #1

I found this page https://gist.github.com/laanwj/efe29c7661ce9b6620a7 and it says

Quote
-maxconnections=<n> - the maximum number of connections, this defaults to 125. Each active connection takes up some memory. Only significant if incoming connections are enabled, otherwise the number of connections will never be more than 8.

The part that I am most interest in is, Each active connection takes up some memory. Only significant if incoming connections are enabled.  How much memory would each connection need/use?

It doesn't seem that limiting it to values lower than 10 reduce the memory usage much further according to my results.  Take for example, a Bitcoin and an altcoin (TekCoin) daemon:

The configuration is limited to 3:
Code:
 
maxconnections=3

Bitcoin is currently connected to 3 peers:
Code:
 
[connections] => 3

The memory usage
Code:
 1702 nobody         13  22    2   720M   304M uwait  653:12   0.00% /usr/local/bin/bitcoind -conf=/usr/local/etc/bitcoin.conf -d

For my altcoin, I have limited it to 10

Code:
 
maxconnections=10

It currently has 8 peers connected
Code:
 
[connections] => 8

The memory usage

Code:
 29953 nobody         11  52   20   414M   345M wait    1   4:10   4.93% /usr/local/bin/tekcoind -conf=/usr/local/etc/tekcoin.conf


I currently have all my coin daemons limited to 3 connections thinking it will save RAM, but it looks like I may not be.  Also, is it true that if I have it limited to a value less than 8, then the daemon will not accept incoming connections?

tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 500



View Profile WWW
November 13, 2014, 12:38:01 AM
 #2

Some more experimenting with memory usage.  I've increased the maxconnections to 15 and there are currently 12 peers

Code:
62753 nobody         10  45   20   418M   346M uwait   1  18:31   5.96% /usr/local/bin/tekcoind -conf=/usr/local/etc/tekcoin.conf

The memory usage appears to have gone up only by a few kilobytes.  So it looks like each connection uses a very small amount of resources.

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!