Bitcoin Forum
November 10, 2024, 05:32:58 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind 0.9.2 uses 800MB of RAM at 30 connections!  (Read 1414 times)
monsterer (OP)
Legendary
*
Offline Offline

Activity: 1008
Merit: 1007


View Profile
July 31, 2014, 02:20:27 PM
 #1

Hi guys,

I just upgraded to bitcoind 0.9.2 hoping to save some memory from version 0.8.4 only to discover it uses more RAM!

What on earth is it doing that requires 800MB of non-virtual memory?

Is there any way to reduce this number, as its 20% of my 4GB total!

Cheers, Paul.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 31, 2014, 02:58:58 PM
 #2

The memory pool is getting larger as is the UTXO (the UTXO isn't in memory but the db does cache it to improve performance - thanks gmaxwell).  Honestly memory usage is going to continue to rise.  I know this sounds like a cop-out but RAM is dirt cheap why not go to 8GB?  Any optimizations you make now are likely to be minimal and if Bitcoin continues to grow so will the memory pressure.

Still 800MB does seem high for 30 connections.  What OS? How many addresses & txns in the wallet?  Addresses more than txn but both seem to increase memory.

There may be a "luck of the draw" element as I have 128 connections right now and memory is <700 MB.  If by luck your peers are making a more diverse range of requests it could be causing the db to cache more heavily?  You can't control who connects to you but you can cap the number of connections.  16 is a good number as you are making available as many inbound slots are you are using outbound.

There is also a command line or configuration file option "dbcache=x" where x is the max db cache size in MBs.  By default it is 100 MB.  Warning I have only increased not decreased the value so I would test the effects on performance in a non-production environment.
monsterer (OP)
Legendary
*
Offline Offline

Activity: 1008
Merit: 1007


View Profile
July 31, 2014, 03:18:45 PM
 #3

The memory pool is getting larger as is the UTXO (the UTXO isn't in memory but the db does cache it to improve performance - thanks gmaxwell).  Honestly memory usage is going to continue to rise.  I know this sounds like a cop-out but RAM is dirt cheap why not go to 8GB?  Any optimizations you make now are likely to be minimal and if Bitcoin continues to grow so will the memory pressure.

Still 800MB does seem high for 30 connections.  What OS? How many addresses & txns in the wallet?  Addresses more than txn but both seem to increase memory.

There may be a "luck of the draw" element as I have 128 connections right now and memory is <700 MB.  If by luck your peers are making a more diverse range of requests it could be causing the db to cache more heavily?  You can't control who connects to you but you can cap the number of connections.  16 is a good number as you are making available as many inbound slots are you are using outbound.

There is also a command line or configuration file option "dbcache=x" where x is the max db cache size in MBs.  By default it is 100 MB.  Warning I have only increased not decreased the value so I would test the effects on performance in a non-production environment.

10 transactions and around 100 addresses. Centos 6.

Increasing RAM is one way, but it'll add to my hosting bill. :|

Cheers, Paul.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 31, 2014, 03:34:57 PM
 #4

Yeah I am at a loss unless it is just bad luck due to the peer mix.  I assumed it was a much larger wallet (thousands of keys and transactions).
azeteki
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 31, 2014, 08:18:48 PM
 #5

This interests me as I'm rather confused as to what seems to be causing various users to report different memory usage.

A few people on IRC seem to have ~300MB or less. I personally report over 700MB on mainnet.

If the low memory usage reports are indeed legitimate it would be useful to track this down.

Cranky4u
Hero Member
*****
Offline Offline

Activity: 810
Merit: 1000



View Profile WWW
July 31, 2014, 10:49:10 PM
 #6

If developers think 800MB is acceptable and trending higher is expected, how in hell does the BTC community expect to become an everyday mobile app for commerce?


DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 31, 2014, 11:04:32 PM
 #7

If developers think 800MB is acceptable and trending higher is expected, how in hell does the BTC community expect to become an everyday mobile app for commerce?

Bitcoind doesn't run on any mobile platform.  What mobile app runs a full node?  None?  Full nodes are the backbone of the network.
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 31, 2014, 11:16:01 PM
 #8

If developers think 800MB is acceptable and trending higher is expected, how in hell does the BTC community expect to become an everyday mobile app for commerce?

Bitcoind doesn't run on any mobile platform.  What mobile app runs a full node?  None?  Full nodes are the backbone of the network.
Why not trade performance(i.e the caching in memory) for...get this, performance! Well, performance of the OS, and let pool operators modify the client to fit their needs. This way, Bitcoin Core would use less RAM for regular people willing to run a full node.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
monsterer (OP)
Legendary
*
Offline Offline

Activity: 1008
Merit: 1007


View Profile
August 03, 2014, 10:33:30 AM
 #9

Is it possible to have linux limit the maximum ram usage on a per-process basis?

Wonder whether bitcoind would run ok with only 100MB of real ram and the rest virtual?
Meuh6879
Legendary
*
Offline Offline

Activity: 1512
Merit: 1012



View Profile
August 03, 2014, 12:03:04 PM
 #10

decrease CACHE to 10Mo (or 5Mo).
start inline command with 12 connexions max.

https://en.bitcoin.it/wiki/Running_Bitcoin
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1001


https://gliph.me/hUF


View Profile
August 03, 2014, 02:12:40 PM
 #11

Some more numbers:

0.9.2.1 --disable-wallet
65 connections

top:
220 MB or ~10%

smaps:
(http://superuser.com/questions/102005/how-can-i-display-the-memory-usage-of-each-process-if-i-do-a-ps-ef)
* Mem usage for PID 17843
-- Size:
132
-- Rss:
56
-- Pss:
56

I run it with some niceness, although that should not affect memory use.


Is it possible to have linux limit the maximum ram usage on a per-process basis?

ulimit?
http://linuxcommand.org/man_pages/ulimit1.html
Quote
ulimit [-SHacdflmnpstuv [limit]]
              Provides control over the resources available to the  shell  and
              to  processes started by it, on systems that allow such control.


OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
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!