After the price of many cryptocurrencies increased substantially in the last months of 2017, their respective blockchains also grew considerably following the increased interest. This makes the initial blockchain sync next to impossible on a slower or even a more modern hardware and internet connection. The listed minimum hardware requirements are usually enough for running a node but not for an initial sync. Plenty of configuration guides repeat the same advice that is no longer enough for reasonable sync times.
This usually includes some of the following steps:
- increase database cache size - this helps up to a point as it is usually only a read cache, so it does not help with write speeds
- use SSD - it is true that hey are way faster but blockchains are huge so not everyone can afford it or the write amplification that is required
- use a light wallet - depending on the currency you may want to help the network by helping new nodes sync
- download the whole blockchain from somewhere - you still have a lot of work verifying transactions
- symlink some directory or files to split the load among an SSD and HDD to get the best of both worlds - this is a bit harder to do but is better as a long term solution. It also has some drawbacks. In the case of Bitcoin it is best to either have the chainstate directory or everything but blk and rev files on an SSD. This is even harder to do for other blockchains as it is hard to identify which files are random accessed and which are sequential. On top of that, at least on Windows, deleting a symlink leaves the original file so you need to be sure that you only symlink files that are longlived (as is the case with blk and rev files in Bitcoin). Else you end up with more files than you need and with no way to tell them apart except copying all symlinks to a third partition, which copies the real files. Yet again you may not have an SSD or you may not want it to suffer the load.
Never access files over USB if you need fast random access. Even USB3 is as fast as HDD in latency and operations per second.
A RAM disk is only useful for initial sync and you need to be prepared to lose everything that is on it at any time, be it a power outage, low memory situations, computer crashes and endless other reasons. So never leave keys or anything of importance there thinking that it will survive this time, no it won't, especially this one time when you need it the most. Only copy to it files that you already have backed up somewhere safe.
Remember the part where it is hard to identify which files are needed the most and split them to a faster medium? Why not let the operating system do the work for us. This is exactly what the pagefile is for. A pagefile is where rarely accessed memory pages are written to in order to free up system memory or RAM. I guess you see where this is going. Of course if you do not have an SSD you also do not have enough RAM to fit a blockchain in it. What you can do instead is provide enough pagefile space on a HDD and create a RAM disk that is big enough to fit said blockchain. You need RAM disk software that allows for this. ImDisk is tested and working with a RAM disk twice the size of installed RAM. By default Windows manages pagefile automatically so this should not be a problem. A better alternative is to set it manually and only use one pagefile per HDD ot avoid long seek times.
At first it may seem counterintuitive to give less memory to database cache but it increases not only read speeds but also write speeds. Blockchains use some kind of database that needs to flush content to disk as soon as possible to avoid data loss. This is what makes the initial sync so slow. With a RAM disk this step is much faster and if it fails you can do it again. Of course once you complete the initial sync you need to copy the data directory to a reliable storage for regular use. And this one will be slow, very slow, especially if the pagefile and the destination are on the same device because of seek times. And even then this is expected to be faster because of sequential reads and writes.
It may be a bit too much in the case of Bitcoin with its close to 170GB blockchain as of today but this trick is still helpful for its 3.3GB chainstate directory that is under heavy random access loads during the initial sync. So a symlink to a 3.5GB RAM disk would make it possible to sync even on 4GB of installed memory with the rest of the OS and programs utilizing the pagefile. It could potentially spare some write cycles in the case of an SSD and still be faster.
And never put a pagefile inside RAM disk! That is ridiculous but it still shows up every time you write RAM disk or pagefile in a search engine.