Bitcoin Forum
November 14, 2024, 12:44:44 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Excessive disk usage during block chain download  (Read 5793 times)
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 26, 2012, 10:19:17 AM
 #1

My Bitcoin client is currently downloading block chain over 100 megabit local network at about 35 blocks per minute. Hard disk indicator is flashing all the time. Responsiveness of many programs is very bad. "top" reports that over 40% of CPU time is being spent on I/O waiting. At such low speed, it will take hours to download the full chain, and finish torturing my HDD. This is annoying.

Download of at least first 100000 blocks went quite fast. It seems like the problems began after a certain block. Both bitcoind and bitcoin-qt exhibit the problem. I ran bitcoind with strace for some time, and it didn't show that any disk-related syscalls take too long time. My guess is that excessive disk activity may be caused by large number of munmap calls.

Relevant system information:
HDD: Seagate ST3500413AS SATA
MB: A8N-E
CPU: AMD Athlon 64 X2 4200+
OS: Slackware Linux 13.37 2.6.37.6 x86_64
FS: ext4
BDB: 5.3.21
Bitcoin: 0.6.3
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
August 26, 2012, 10:23:50 AM
 #2

https://bitcointalk.org/index.php?topic=74873.10

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 26, 2012, 11:49:00 AM
 #3

Thanks, Revalin. I temporarily moved files blk0002.dat, blkindex.dat, and the folder "database" to RAM storage. This resulted in significant reduction in disk usage.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
August 26, 2012, 11:51:51 AM
 #4

If your goal is to just get started then you can just download a recent copy of the blockchain from here:

http://eu1.bitcoincharts.com/blockchain/

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 26, 2012, 12:00:14 PM
 #5

If your goal is to just get started then you can just download a recent copy of the blockchain
This is a way to go. However, I opine that bootstrapping Bitcoin instances from instances that already exist in the same LAN should be a reasonable technique. I'd like the Bitcoin client to be able to perform initial block chain download smoothly.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
August 26, 2012, 12:14:01 PM
 #6

Everyone agrees.  It's a long-term goal to keep improving performance.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
racerguy
Sr. Member
****
Offline Offline

Activity: 270
Merit: 250


View Profile
August 26, 2012, 07:55:02 PM
 #7

If you're doing this over a local network why not just copy the blockchain from the other computer on your network that already has it? 
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 27, 2012, 09:59:49 AM
 #8

why not just copy the blockchain from the other computer on your network that already has it?
For sake of verification.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
August 27, 2012, 03:02:06 PM
 #9

why not just copy the blockchain from the other computer on your network that already has it?
For sake of verification.

Meh.  Didn't the first computer verify it already?

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 28, 2012, 11:53:54 AM
 #10

Didn't the first computer verify it already?
In this particular case, it did not. In any case, I sometimes may wish to verify data.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1036



View Profile WWW
August 28, 2012, 11:24:25 PM
Last edit: October 25, 2013, 10:58:50 AM by deepceleron
 #11

The Bitcoin client does not simply download blocks and store them. It adds information about blocks, transactions, and addresses to a database with an index, and it is the building of this index, along with verification of the cryptographic hashes and signatures of all transactions that have taken place, which heavily utilizes storage and CPU resources.

If you wish to re-download the blockchain for the sake of re-verification, you can create a 4GB RAM disk (if you have 6+ GB of RAM), and utilize this as your -datadir. This will remove the bottleneck of limited I/O operations per second from a spinning hard drive with moving heads. Then you will be limited by the CPU speed of the system running Bitcoin. Of course move the downloaded blockchain to a more permanent location before powering off your computer...

Later blocks have many more transactions, thus take longer to download, the top graph shows the current block number after the elapsed time downloading, the bottom graph shows the blocks per second at a particular block height (notice how abysmal it gets at the very end):

Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
August 29, 2012, 12:28:07 PM
 #12

you can create a 4GB RAM disk
That's a kind of what I had to do.
zvs
Legendary
*
Offline Offline

Activity: 1680
Merit: 1000


https://web.archive.org/web/*/nogleg.com


View Profile WWW
August 30, 2012, 04:37:31 AM
 #13

whenever i need to redownload the blockchain or need to catch up a lot, I'll just use the connect option to connect to one (fast) node...    seems a lot quicker like that
srf21c
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
November 13, 2012, 11:17:34 PM
Last edit: November 14, 2012, 02:34:41 AM by srf21c
 #14

I have the same issue when trying to sync the blockchain after a fresh installation. The disk usage is so intense it makes the system unusable and literally takes days, sometimes a full week to finish. And this is on a system with an SSD!!

This is a serious issue that is going to drive away new non-technical users. I will try the ramdisk work around in the mean time.
phr33
Full Member
***
Offline Offline

Activity: 226
Merit: 100


View Profile
November 17, 2012, 10:46:42 AM
 #15

I'm running a bitcoin client in a virtual machine. I put the VM image on a mechanical disc first, but the performance was too low. It took forever to download the block chain. Moved the image to an SSD and performace increased with an order of magnitude.

My BTC input: 1GAtPwoTGPQ35y9QugJueum5GzaEzLYjiQ
My GPG ID: B0CCFD4A
Yurock (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
November 17, 2012, 01:14:54 PM
 #16

I'm running a bitcoin client in a virtual machine. I put the VM image on a mechanical disc first, but the performance was too low. It took forever to download the block chain.
What kind of VM?
srf21c
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 27, 2013, 11:09:37 PM
 #17

I think I may have stumbled across a solution to this problem, disable barrier writes on ext4 for the first blockchain sync

It involves remounting the filesystem like so sudo mount -o remount,nobarrier /

For those using btrfs filesystem, disabling CoW (Copy on Write) for the .bitcoin folder might also help alleviate this problem.

chattr +C </dir/file>
ISAWHIM
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
May 28, 2013, 10:18:53 AM
 #18

Also note... Defragment after downloading the block chain. Even on an SSD... it fragments into billions of tiny fragments, stuffing itself into every nook and cranny, in UNSEQUENTIAL order... thus, this, like steam-games and torrents, gets an instant boost for loading, by defragmenting after downloading.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!