electrs icon indicating copy to clipboard operation
electrs copied to clipboard

DB uses ~55% as much space as the blockchain during full compaction

Open reardencode opened this issue 5 years ago • 3 comments

The documentation says that it'll use up to 35% of the size of the blockchain near the end of sync, and this is true. However, during compaction it uses that ~35%+~20% of the final DB size.

You should at least warn about this, and possibly make --jsonrpc-import enable compaction throughout rather than compacting fully at the end (possibly optional behavior) for those of us running on resource limited machines.

reardencode avatar May 28 '20 18:05 reardencode

What would you think about a safety measure that turns on --json-rpc if there's low space available?

Kixunil avatar May 28 '20 18:05 Kixunil

Combined with enabling compaction throughout import for --jsonrpc-import mode, I think that'd be great. IIUC that trade-off will be slower more IO intensive import, but lower RAM and disk usage.

reardencode avatar May 28 '20 18:05 reardencode

Yes, and it took ~1.5 GB of RAM during import. Would be nice to mention that in the docs too.

schildbach avatar Nov 15 '20 09:11 schildbach

This issue should be addressed by the latest release:

$ du -sh electrs/db/bitcoin .bitcoin/blocks/
39G	electrs/db/bitcoin
509G	.bitcoin/blocks/

romanz avatar May 15 '23 15:05 romanz