I'm trying to run electrs on an Odroid HC1, with 2GB RAM along with 4GB of swap space on an SSD. Every time I try to start, it crashes within a few minutes due to a memory allocation error. I'm running bitcoind 0.17. If I run top in a separate terminal, I do see memory increase spike on the indexing 1391 blk*.dat files log message (which is shortly before the crash), but it doesn't reach 100% usage or even particularly close to it and it doesn't use the swap file.
Finished release [optimized] target(s) in 0.47s
Running `target/release/electrs -vvv --timestamp --db-dir ./db '--cookie=bitcoinuser:ZMEDcCZCR48nwkhovdAonN1sX9WuEFxe'`
Config { log: StdErrLog { verbosity: Debug, quiet: false, timestamp: Millisecond, modules: [], writer: "stderr", color_choice: Auto }, network_type: bitcoin, db_path: "./db/mainnet", daemon_dir: "/home/bitcoin/.bitcoin", daemon_rpc_addr: V4(127.0.0.1:8332), cookie: Some("bitcoinuser:[password redacted]"), electrum_rpc_addr: V4(127.0.0.1:50001), monitoring_addr: V4(127.0.0.1:4224), jsonrpc_import: false, index_batch_size: 100, bulk_index_threads: 8 }
2018-09-29T19:49:53.386-04:00 - DEBUG - Server listening on 127.0.0.1:4224
2018-09-29T19:49:53.389-04:00 - DEBUG - Running accept thread
2018-09-29T19:49:53.391-04:00 - INFO - NetworkInfo { version: 170000, subversion: "/Satoshi:0.17.0/" }
2018-09-29T19:49:53.396-04:00 - INFO - BlockchainInfo { chain: "main", blocks: 543671, headers: 543671, bestblockhash: "0000000000000000001abcd475b4dc0f5414a753c72e2b06c1ac6f459b11c2c0", pruned: false, initialblockdownload: false }
2018-09-29T19:49:53.397-04:00 - DEBUG - opening DB at "./db/mainnet"
2018-09-29T19:49:53.423-04:00 - INFO - listing block files at "/home/bitcoin/.bitcoin/blocks/blk*.dat"
2018-09-29T19:49:53.442-04:00 - INFO - indexing 1391 blk*.dat files
2018-09-29T19:49:53.442-04:00 - DEBUG - found 0 indexed blocks
2018-09-29T19:50:58.186-04:00 - DEBUG - applying 543672 new headers from height 0
memory allocation of 40304640 bytes failedAborted
Thanks for opening this issue!
I would suggest using the following command line (#38):
cargo run --release -- -vvvv --index-batch-size=10 --jsonrpc-import
The indexing should take more time and use less RAM.
That seemed to work, thanks! I'm currently getting a Block not found on disk error but I think it's unrelated to electrs. Should I add these command args to the instructions?
Glad to hear it works :)
I'm currently getting a
Block not found on diskerror
Please let me know if this error is correlated with electrs usage.
Should I add these command args to the instructions?
Yes, I'd be happy to update the usage instructions to support embedded Linux platforms :)
FYI, looks like I have a corrupted blk00??.dat file on disk so I'll need to do a reindex which will take some time to complete before I can resume syncing electrs. Actually, do you happen to know if I would need to start syncing electrs all over again? Or should it be fine to just pick up where I left off after the reindex is complete.
I'd suggest to reindex again because electrs trusts the blocks' data returned by the Bitcoin node.
So looks like I had some hard drive issues and needed to RMA which turned into a bit of an ordeal, but I'm happy to report I'm finally back up and running and just completed the full sync!
Great :)