Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Dabs on October 26, 2016, 01:55:55 PM



Title: RAM drive or SSD to hold blockchain.
Post by: Dabs on October 26, 2016, 01:55:55 PM
Serious Question, for those using Bitcoin Core or anything similar that stores the blockchain.

Aside from the very fast speeds, any other advantage to storing the entire blockchain in a RAM drive? I mean, if I have 96 GB of RAM, or 128 GB ...

Or are SSDs "more than enough" ? Can get a 128 GB or 256 / 240 GB SSD just to store the blockchain.

Use case: loading and rescanning different wallets. As in different wallet.dat files. So of course I'm not using pruning mode, I'm keeping the whole chain. If I had the RAM, yeah, it would be so much faster. SSDs, still faster than any mechanical HDD. I just don't know if anyone has tried it yet (maybe the big companies out there have tried it.)

Currently I'm using a slow hard drive, and when I rescan my wallet (which has addresses as far back as 2013) it takes at least 15 minutes before the GUI shows up. If I rescan a newer wallet (with addresses generated in 2016), it still takes about 5 minutes.

Maybe this would be just a "Waste" of RAM. It's just that I am finding a lot of older hardware selling for cheap, with DDR3 or even DDR2 RAM, those are still faster than SSDs.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: achow101 on October 26, 2016, 02:00:38 PM
Well a RAM drive would make shutting down the computer a major pain since the entire blockchain would have to be dumped to the disk, unless you want to resync the whole thing every time you start the computers.

An SSD is usually enough. I think one of the bigger bottlenecks is in the CPU.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Carlton Banks on October 26, 2016, 03:10:52 PM
Yep, SSD is sufficient, especially if you get something that isn't impeded by SATA 3 speeds (~550MB/s), or the AHCI software interface. Most 2016 era BIOS'es support NVME and booting from PCI express SSDs. But even something older will benefit from SSD performance.

For the workloads you mentioned, I've been using SSDs for the longest time, I can't actually remember whether I ever tried it with mechanical disks. All I know is that it would mean far too much waiting around, 15 minutes to rescan wallets sounds tortuous. Ramdisk would probably only be practical or cost-effective for miners; you might have a spare PC with 128GB RAM today, but the blockchain can expand anything up to ~ 5 GB per month.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: veleten on November 01, 2016, 04:49:02 AM
I have my wallet on an old(2005) Toshiba laptop with 256mb RAM and originally 20gb hard drive
bought a very cheap SSD 128 gb for 78$ and now I have a hardware wallet that I only use for storing bitcoins
I connect it to internet once in a while to sync and only use it to check on my precious coins,nothing else


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Clement Kaliyar on November 01, 2016, 07:48:27 AM
you might have a spare PC with 128GB RAM today, but the blockchain can expand anything up to ~ 5 GB per month.

if I have 96 GB of RAM, or 128 GB ...

Are you guys talking about 128 GB of RAM  ??? i am using 16 GB of RAM which i thought is superior  :) SSD is faster than any mechanical drives but be careful about power outrages when you are using SSD


Title: Re: RAM drive or SSD to hold blockchain.
Post by: shorena on November 01, 2016, 08:13:23 AM
you might have a spare PC with 128GB RAM today, but the blockchain can expand anything up to ~ 5 GB per month.

if I have 96 GB of RAM, or 128 GB ...

Are you guys talking about 128 GB of RAM  ??? i am using 16 GB of RAM which i thought is superior  :) SSD is faster than any mechanical drives but be careful about power outrages when you are using SSD

Probably on a server, RAM is pretty cheap atm.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Zz on November 01, 2016, 08:44:25 AM
seriously? 128GB RAM :)

my Desktop system :
Intel Skylake Core i7 6700K 4.0GHz 8MB 1151p
Asus H110M-C DDR4 2133MHz VGA 1151p
Kingston Hyperx S 16GB (2x8) 3000MHz DDR4 HX430C15SB2K2/16
testining on Ubuntu 16.10 dd command.

test units
Seagate Barracuda 3.5 1TB 7200Rpm 64Mb Sata 3 ST1000DM003
Kingston 240GB V300 SSD Disk SV300S37A/240G
and
my ram disk : 8GB

all file systems ext4 (-i 4096MB)

my ram disk setup :
mkdir /ram
mount -t tmpfs -o size=8192M tmpfs /ram


my ram drive write speed :

root@kutaypc:/ram#  dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 kayıt girdi
1024+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,326958 s, 3,3 GB/s


my SSD drive write speed :

root@kutaypc:/home#  dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 kayıt girdi
1024+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,577785 s, 1,9 GB/s

my HDD drive write speed :

root@kutaypc:/disk2#  dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 kayıt girdi
1024+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 4,60376 s, 233 MB/s


WRITE test results : RAM > SSD > HDD

root@kutaypc:#sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"


my ram drive read speed :
root@kutaypc:/ram# dd if=./largefile of=/dev/null bs=4k
262144+0 kayıt girdi
262144+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,20474 s, 5,2 GB/s

my SSD drive read speed :
root@kutaypc:/home# dd if=./largefile of=/dev/null bs=4k
262144+0 kayıt girdi
262144+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 2,21521 s, 485 MB/s

my HDD drive read speed :
root@kutaypc:/disk2# dd if=./largefile of=/dev/null bs=4k
262144+0 kayıt girdi
262144+0 kayıt çıktı
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 9,81372 s, 109 MB/s

READ test results : RAM > SSD > HDD


Title: Re: RAM drive or SSD to hold blockchain.
Post by: shorena on November 01, 2016, 02:02:40 PM
seriously? 128GB RAM :)

-snip-

There interesting test results would be:

#1 load blockchain from SSD to RAM-DISK
#2 load new wallet file
#3 let it resync
repeat #2, #3 as needed
(#4) safe updated blockchain from RAM-DISK to SSD for next session

vs.

#1 load new wallet file
#2 let it resync

As achow101 pointed out, the bottleneck might be elsewhere.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 01, 2016, 05:22:43 PM
Yes, lots of RAM on old server hardware, usually off-lease units that are refurbished. Take a look at ebay, or servermonkey.

My test server is currently at 48 GB of RAM. It's only DDR3, so it's not the latest greatest DDR4. It cost me about $600 USD last year. I think RAM for these types of servers is priced at $300 US for every 128 GB. They are also ECC.

I guess I could just buy 2 or 4 SSDs instead, and run them in RAID0.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Grinder on November 01, 2016, 05:54:40 PM
The price per GB is about 20 times higher for the cheapest RAM than it is for the cheapest SSDs. SSDs are much faster at random access than mechanical drives so you'll get a very significant speed up by moving the blockchain to an SSD, more than a simple sequential transfer test would indicate.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 01, 2016, 07:10:03 PM
The price per GB is about 20 times higher for the cheapest RAM than it is for the cheapest SSDs. SSDs are much faster at random access than mechanical drives so you'll get a very significant speed up by moving the blockchain to an SSD, more than a simple sequential transfer test would indicate.

True. But I wouldn't need more RAM than maybe double the size of the blockchain. 96 GB would be cutting it too close, but 128 GB should be fine for at least until next year, 2017.

For most people, (even me) I'd probably just get a 240 GB or larger SSD for "bitcoin purposes". I'm not too concerned about losing my copy, I have at least a few thousand backups online. :)


Title: Re: RAM drive or SSD to hold blockchain.
Post by: LoyceV on November 03, 2016, 08:17:52 AM
I have tried it, but with a pruned chain. I can confirm it was faster to download the full blockchain compared to doing the same thing (also pruned) on my SSD. Test results: at the start, it was limited by my Wifi speed (2-3 MB/s), later on it was limited by my CPU (i3).

Obviously I don't have enough ram to do this without pruning, so I can't test a rescan. My HDD takes about 40 minutes to do a full rescan (for instance when I import a private key).
If you're now using a slow HDD, I'd say switching to a SSD is enough for a big improvement. If it reads 500 MB/s, it can read the entire blockchain in 3 minutes.

Personally I only use ram-drives for temporary files. I don't want to have to backup data, although you could argue you can always download it again.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Grinder on November 03, 2016, 10:59:39 AM
Seems this would be even more expensive than I thought. You need a socket 2011(-3) mainboard to get support for 128 GB or more RAM, which means that both the mainboard and CPU will be more expensive than normal consumer hardware.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 03, 2016, 02:27:57 PM
Seems this would be even more expensive than I thought. You need a socket 2011(-3) mainboard to get support for 128 GB or more RAM, which means that both the mainboard and CPU will be more expensive than normal consumer hardware.
Look at previous generation server hardware or workstations. Good prices for many CPUs and many cores and lots of RAM. (Yes, they will be refurbished or off-lease or old or used.)


Title: Re: RAM drive or SSD to hold blockchain.
Post by: calkob on November 03, 2016, 08:40:24 PM
96GB of ram,,,, wow

i am using 16GB ram and am running a full node on a standard HDD drive, it works fine and i have no problems at all.  ;D


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 04, 2016, 03:32:02 AM
I'm currently on a laptop. 8 GB RAM, so you're double what I have. Also slow HDD drive.

Will be "upgrading" to an old refurbished workstation ... comes with 64 GB, should be a big improvement, and more browser tabs (and virtual machines).


Title: Re: RAM drive or SSD to hold blockchain.
Post by: shield132 on November 04, 2016, 06:45:00 AM
Well, I know that SSD Hard Drives are very fast and nowdays faster than any other hard drive but why do you need to store blockchain in a RAM drive? I amn't newbie but I can't understand how you can to store something on installed memory (RAM)
I can't understand what you say about RAM but I would say that store blockchain in your SSD, it's good and search time will be fast also with good CPU/RAM.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 04, 2016, 01:02:02 PM
Well, I know that SSD Hard Drives are very fast and nowdays faster than any other hard drive but why do you need to store blockchain in a RAM drive? I amn't newbie but I can't understand how you can to store something on installed memory (RAM)
I can't understand what you say about RAM but I would say that store blockchain in your SSD, it's good and search time will be fast also with good CPU/RAM.
You just said it. RAM drive. Look it up if you don't know what that is. If you're using Windows, you have some app or something, and it eats a chunk of your memory, and you see a new drive letter, say R: or X:, Y:, Z:.

I don't need to answer the "why", ... if it's possible, someone will do it anyway.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Carlton Banks on November 04, 2016, 05:15:31 PM
I don't need to answer the "why", ... if it's possible, someone will do it anyway.

There was definitely a p2pool miner on bitcointalk who ran a Ram drive for his mining rig for a while. It's in the p2pool thread somewhere.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: shorena on November 04, 2016, 07:14:25 PM
Well, I know that SSD Hard Drives are very fast and nowdays faster than any other hard drive but why do you need to store blockchain in a RAM drive? I amn't newbie but I can't understand how you can to store something on installed memory (RAM)
I can't understand what you say about RAM but I would say that store blockchain in your SSD, it's good and search time will be fast also with good CPU/RAM.
You just said it. RAM drive. Look it up if you don't know what that is. If you're using Windows, you have some app or something, and it eats a chunk of your memory, and you see a new drive letter, say R: or X:, Y:, Z:.

I don't need to answer the "why", ... if it's possible, someone will do it anyway.

I guess the answer to "why?" is "why not?" I have been holding back on this for a while, but I think I will just post how cheap this is. I dont think people understand this from a desktop/laptop perspective. If you have a place to put these loud and heavy boxes and can afford the running cost you can easily get one with enough RAM to support a blockchain.

Heading over to ebay (germany first)... searching for the rack mounted servers category and picking 128 GB(!) RAM gets me:

HP Proliant DL585 G6[1]
price: 429 EUR
CPU: 4*6 = 24 Core 2,6GHz AMD Opteron
RAM: 32*4 GB = 128GB DDR2 (no ECC?)
Just needs a few disks and is good to go

There is even one[2] with similar specs for 349 EUR.

If you are saying "booo, ddr2 sucks", get this[3] one for 774 EUR.

CPU: 2*6 = 12 Core, 2,66Ghz Xeon X5650
RAM: 16*8 = 128 GB DDR3
DISK: 2*300 GB SAS

Same in the UK[4], 8 Cores, 128 GB DDR3, 537 GBP.

and the US[5], 8 Cores, 128 GB DDR3, 569 USD.

[1] http://www.ebay.de/itm/HP-Proliant-DL585-G6-4x-Six-Core-2-6GHz-8435-128GB-RAM-Rackschienen-/401041664720
[2] http://www.ebay.de/itm/HP-ProLiant-DL580-G5-4x-QuadCore-Xeon-E7430-16x-2-13-GHz-128-GB-RAM-4x146-GB-HDD-/112193516338
[3] http://www.ebay.de/itm/IBM-X3550-M3-2x-Xeon-X5650-6-Core-2-66GHz-128GB-RAM-600GB-SAS-HDD-Raid-2x-PSU-/222264199184
[4] http://www.ebay.co.uk/itm/HP-PROLIANT-DL360-G7-SERVER-TWO-E5506-2-13GHZ-128GB-600GB-10K-SAS-P410I-/311732562256
[5] http://www.ebay.com/itm/HP-PROLIANT-DL360-G7-SERVER-TWO-E5506-2-13GHZ-128GB-2-X-146GB-10K-SAS-P410I-/192016881457


Title: Re: RAM drive or SSD to hold blockchain.
Post by: smho_16 on November 04, 2016, 08:28:37 PM
I have tried it, but with a pruned chain. I can confirm it was faster to download the full blockchain compared to doing the same thing (also pruned) on my SSD. Test results: at the start, it was limited by my Wifi speed (2-3 MB/s), later on it was limited by my CPU (i3).

Obviously I don't have enough ram to do this without pruning, so I can't test a rescan. My HDD takes about 40 minutes to do a full rescan (for instance when I import a private key).
If you're now using a slow HDD, I'd say switching to a SSD is enough for a big improvement. If it reads 500 MB/s, it can read the entire blockchain in 3 minutes.

Personally I only use ram-drives for temporary files. I don't want to have to backup data, although you could argue you can always download it again.

So getting a 960 GB SSD is the ultimate solution to increase speed when rescanning the bitcoin core ? It's quite expensive but I think it maybe worth it. Personally I don't use bitcoin core that much but I have it sitting on my Laptop Core i5 and a really old HDD 750 GB and is extremely slow. I think the SSD with big space is the best solution to such problem. Price is the same as a big server ram for such huge space SSD.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 04, 2016, 10:47:14 PM
I guess the answer to "why?" is "why not?" I have been holding back on this for a while, but I think I will just post how cheap this is. I dont think people understand this from a desktop/laptop perspective. If you have a place to put these loud and heavy boxes and can afford the running cost you can easily get one with enough RAM to support a blockchain.

Heading over to ebay (germany first)... searching for the rack mounted servers category and picking 128 GB(!) RAM gets me:

...

That's what I'm saying, these old hardware, DDR2 or DDR3 with that much RAM, and that many cores ... they're cheap now. I see videos on youtube for stuff with 1 TB of RAM. I heard about a server with 4 TB of RAM that only does DNS or something like that, stored everything in memory.

I'm almost never buying a desktop or laptop again... okay, maybe a laptop. I get an old server or workstation for cheap, and it has triple or quadruple the RAM everyone else has, with double or triple the cores everyone else has, put in a previous generation GPU, and I can play the latest games... (I think.) Or play two players with two keyboards and two monitors and two mice. Or I think Linus even did 7 to 8 gamers in one rig. (That's not fair, they used 36 core CPUs, and 8 GPUs on one motherboard.)


Title: Re: RAM drive or SSD to hold blockchain.
Post by: shorena on November 05, 2016, 06:34:07 AM
I guess the answer to "why?" is "why not?" I have been holding back on this for a while, but I think I will just post how cheap this is. I dont think people understand this from a desktop/laptop perspective. If you have a place to put these loud and heavy boxes and can afford the running cost you can easily get one with enough RAM to support a blockchain.

Heading over to ebay (germany first)... searching for the rack mounted servers category and picking 128 GB(!) RAM gets me:

...

That's what I'm saying, these old hardware, DDR2 or DDR3 with that much RAM, and that many cores ... they're cheap now. I see videos on youtube for stuff with 1 TB of RAM. I heard about a server with 4 TB of RAM that only does DNS or something like that, stored everything in memory.

I'm almost never buying a desktop or laptop again... okay, maybe a laptop. I get an old server or workstation for cheap, and it has triple or quadruple the RAM everyone else has, with double or triple the cores everyone else has, put in a previous generation GPU, and I can play the latest games... (I think.) Or play two players with two keyboards and two monitors and two mice. Or I think Linus even did 7 to 8 gamers in one rig. (That's not fair, they used 36 core CPUs, and 8 GPUs on one motherboard.)

I wouldnt really use old servers for gaming. They tend to be old generation CPUs (thus slower) with lower clock speed (slower again) and AFAIK only a few games benefit from a larger number of cores. I have seen that video and IIRC it was done a new set of CPUs. Its also difficult to get driver support for some of the boards, but that can probably be solved by VMs. They are still great for almost every other task (besides maybe spreadsheets ;) ).


Title: Re: RAM drive or SSD to hold blockchain.
Post by: zend7 on November 05, 2016, 07:33:17 AM
I guess the answer to "why?" is "why not?" I have been holding back on this for a while, but I think I will just post how cheap this is. I dont think people understand this from a desktop/laptop perspective. If you have a place to put these loud and heavy boxes and can afford the running cost you can easily get one with enough RAM to support a blockchain.

Heading over to ebay (germany first)... searching for the rack mounted servers category and picking 128 GB(!) RAM gets me:

...

That's what I'm saying, these old hardware, DDR2 or DDR3 with that much RAM, and that many cores ... they're cheap now. I see videos on youtube for stuff with 1 TB of RAM. I heard about a server with 4 TB of RAM that only does DNS or something like that, stored everything in memory.

I'm almost never buying a desktop or laptop again... okay, maybe a laptop. I get an old server or workstation for cheap, and it has triple or quadruple the RAM everyone else has, with double or triple the cores everyone else has, put in a previous generation GPU, and I can play the latest games... (I think.) Or play two players with two keyboards and two monitors and two mice. Or I think Linus even did 7 to 8 gamers in one rig. (That's not fair, they used 36 core CPUs, and 8 GPUs on one motherboard.)

You can buy a 6th generation desktop or even a cheaper 6th laptop and do all the gaming you need with the exact price of those old servers you are talking. An intel i3 6100 for desktop together with an AMD RX 470 is more than enough for 1080p latest gaming. Cost of such PC is 500-550 USD with SSD and 8GB of Ram. If you want to keep also the entire blockchain just buy a 480 GB SSD beside a 1TB hdd which this PC has already itself. Laptops may come even cheaper but not with great GPU.

Lots of new options nowadays so I really suggest you forget about the old servers you are talking as they are not good at all for gaming.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Grinder on November 05, 2016, 08:44:56 AM
I did some testing, and with a Samsung 850 EVO SSD the rescanning is completely CPU-bound because it only uses one core. On a i5-6600K running at 3.8 GHz the usage is constant at ~27% (meaning slightly more than 1 core is used) and the disk usage is ~13% (with rare peaks up to 40%). Rescanning a new empty wallet takes almost exactly 20 minutes + 1.5 minutes for the initial check of the blocks. Rescanning a wallet with 1160 transactions (most of them done several years ago, don't know if that matters) takes 43 minutes. If you buy an old computer with lots of cores and RAM but where each core is slow it would probably take much longer. I think even a laptop with a modern dual core cpu and SSD would be faster than that.


Title: Re: RAM drive or SSD to hold blockchain.
Post by: Dabs on November 05, 2016, 01:55:37 PM
Lots of new options nowadays so I really suggest you forget about the old servers you are talking as they are not good at all for gaming.

The old server workstation I'm talking about would have a CPU that has 4 or 6 cores, 3.1 to 3.6 Mhz, 10 MB cache ... hyper threading and AES NI ... that's all I "need" from it. The gaming is secondary. The mobo will accept the latest GPU, but that would cost more than the rest of the system combined. The system I'm looking at will come with 1 TB HDD (I'll add the SSD later) with space inside for a few more drives, 64 GB of DDR3 ECC RAM, Gigabit Network 10/100/1000, Integrated HD Audio, 4 X USB 3.0 Ports, 5 X USB 2.0 Ports, FireWire Port, and half a dozen SATA ports inside.

It would cost me about $600 USD equivalent, shipped to my house.

So, it's not the best for gaming, but it's more than enough for everything else I will use it for, including whatever cryptocurrency / bitcoin related projects I have. It will run Starcraft fine. It might not run the latest Assassin's Creed or whatever game came out in 2016.

I did some testing, ...

Mine takes about 20 to 30 minutes, but I'm still using a HDD, not SSD. Old laptop with Core i5. (probably 4 cores, or 2 cores with hyper-thread.)


Title: Re: RAM drive or SSD to hold blockchain.
Post by: xdrpx on November 12, 2016, 07:10:42 PM
That's a massive amount of RAM and atleast where I live RAM disks are very expensive for the amount of RAM size you've mentioned. I'm currently using a 256 GB Samsung 750 EVO internal SSD and it's doing pretty good. You'll get decent read and write rates of about 580 MB/s and it has very good endurance of atleast 5 years (stating 5 years cause of the warranty). You'll also find SSD's with 10 years warranty and support a lot of read and write cycles and resistance to heat.

The bitcoin blockchain on it would be worth the money spent and these days prices of SSD's are getting pretty cheap. What you'll need is also a faster processor for the initial sync and about 8GB of RAM (4GB is good enough as well). This should prevent any slowdown and you could use your system at the same time to do other activities. I'd suggest the i7 6700K (Quad core and 6 threads) which packs a punch of power on all its cores and threads. You'll not feel a slowness after all. You might as well run a Bitcoin node on this and I'm sure you're aware that it'd help the network.