Author

Topic: maxconnections and memory usage (Read 1426 times)

hero member
Activity: 780
Merit: 501
November 12, 2014, 07:38:01 PM
#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.
hero member
Activity: 780
Merit: 501
November 12, 2014, 08:25:49 AM
#1
I found this page https://gist.github.com/laanwj/efe29c7661ce9b6620a7 and it says

Quote
-maxconnections= - 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?
Jump to: