3

I have a 60GB SSD as my Windows system drive, which isn't enough to save the entire blockchain to. I installed BitCoin Core (bitcoin-qt) and set the data directory to be on my 2TB HDD. However, the initial blockchain sync is running since 2 days already, currently being '40 Weeks behind'. The HDD is showing 100% load in Windows task manager. CPU is at <50% load, network usage is <1MB/s while syncing.

Can I speed up the initial sync by using the SSD for DB storage, while binary blockchain data is saved to conventional HDD?

Does that actually speed up the sync?

1 Answer 1

3

Yes, it is possible to load the blockchain binary data off to a bulk storage (HDD), while keeping the Index DB on performant storage (SSD). The Bitcoin Blocks are stored in the blocks subdirectory in your datadir. The location of your datadir is either %AppData%\BitCoin, or set manually by you during the installation of bitcoin-qt.

I ASSUME you're using BitCoin Core (aka bitcoin-qt) on Windows 7 or higher, C:\ being your SSD, F:\ being your HDD, bot formated as NTFS. The location of datadir is %AppData%\BitCoin\.

  1. Move %AppData%\BitCoin\blocks to the HDD, e.g. to F:\BTC\blocks

  2. OPTIONAL Move F:\BTC\blocks\index back to the SSD: %AppData%\BitCoin\index

NOTE: The blocks folder must not exist in %AppData%\BitCoin now!

  1. Open a cmd window by pressing WIN+R, then type cmd and click ok

  2. Type/Paste mklink /J %AppData%\BitCoin\blocks F:\BTC\blocks and hit ENTER. (This creates a NTFS Junction, creating a link in %AppData%\Bitcoin called blocks, pointing to the existing F:\BTC\blocks folder on the HDD)

  3. OPTIONAL Type/Paste mklink /J F:\BTC\blocks\index %AppData%\BitCoin\index and hit ENTER (Create new link at F:\BTC\blocks\index pointing to existing %AppData%\BitCoin\index)

Now, the blocks directory is on the HDD for cheap bulk storage, while its index subdirectory and parent datadir is on the speedy SSD. Only binary blockchain data is stored on HDD.

About the index directory (Steps 2, 4): As Pieter Wuille comments below, you don't really need to move the index directory within blocks back to SSD. But since it contains one of the databases, I figured it might help performance when starting up bitcoin-qt. [citation needed]

In my case, this Windows task manager shows read/write speeds 10 times higher than befode (20-30MB/s). Download speed did go up to 2-4MB/s (50MBit Internet), CPU load is up at 85%.

I didn't monitor blocks/second improvement, but the taskmanager values show better throughput of data, which should directly relate to more blocks per second. I synced 15 weeks of blockchain while writing this (30m), versus only 1 week before the modification!

The datadir without binary blockchain data is a little over 2GB, with 25 weeks worth of blockchain still missing. I'd recommend at least 5GB free space on the SSD for the currently 80GB big blockchain.

4
  • 3
    Quite accurate, but the performance of the blocks\index database is actually irrelevant; we only ever write a bit of data to it. There is a different database however, chainstate directory, whose performance is absolutely critical. I'd suggest to move this latter to SSD instead. Sep 16, 2016 at 23:19
  • Thanks for the hint. I'm new to Bitcoin, so I didn't know what each file really does. I'll add a note at the end of my answer about index and mark the relevant steps as optional.
    – NoMad
    Sep 17, 2016 at 10:33
  • 2
    Oracle databases? We use BDB for the wallet. blocks/index and chainstate are LevelDB. Oct 23, 2016 at 20:09
  • Good point, don't know where I read that this is an Oracle DB... I've turned the answer into a community wiki, as I said I don't know too much about bitcoin itself, so if anyone finds more things wrong, please edit as you like.
    – NoMad
    Oct 24, 2016 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.