Page 1 of 1

Slow Syncing Issues

Posted: Wed Apr 09, 2014 2:19 am
by snailbrain
does anyone have a solution to the insane disk access (and locking) with blockchain sync? (i know it has been discussed several times, but seems we never got anywhere with it)
I can add a small 1k Huntercoin bounty (not much value atm) if anyone can sort this with namecoin.

I'm attempting to get libcoin (nmc version) compiled on ubuntu but failing atm (will try again tomorrow) to see if there are any improvements.

Re: Slow Syncing Issues

Posted: Thu Apr 10, 2014 4:32 pm
by cassini
There are quite a few things you can do:
  • Start with parameter -printtoconsole
    (works for namecoind. I'm not sure if this parameter exists in Namecoin-Qt.)
    This alone reduces the synch time substantially. A lot of time is wasted accessing the db files and the debug log file simultaneously.
    You probably want to suppress all the debug display output by sending it to /dev/null (linux, mac) or NUL (windows), e.g.
    ./namecoind -printtoconsole 1>/dev/null
  • Copy the content of an existing and already synchronized directory to your experimental directory (except wallet.dat) and use the parameters -datadir and -conf.
    By the way, I've got several synchronized directories (clones) on my machine and on external harddisks, hence I ALWAYS start namecoind with -datadir and -conf, e.g.
    /nmcdir1/namecoind -datadir=nmcdir1 -conf=nmcdir1/namecoin.conf -printtoconsole
    You need to keep two things in mind, however:
    1.) Always be aware which wallet.dat is currently in use.
    2.) If your conf file contains daemon=1 and you want to issue commands to your namecoin daemon then you have to use the same parameters, of course. For example:
    /nmcdir1/namecoind -datadir=nmcdir1 -conf=nmcdir1/namecoin.conf getinfo
    3.) If it doesn't want to synchronize to the latest blocks then stop and restart with -reindex
  • Run it on an SSD.
    Without the abovementioned tricks the synchronization time in an empty directory on a standard harddisk takes 2 days. On a SSD it's 2 hours.
    (dual-core CPU, high speed network)
Furthermore, there have been experiments with bootstrap.dat by indolering and phelix, if I recall correctly. I can't find the forum thread at the moment, and they may be out of date. The idea is you download the whole datadir content as one zip file, unzip to your datadir, and start the namecoin client with -reindex.
Any news on this? Indolering? Phelix?

Re: Slow Syncing Issues

Posted: Thu Apr 10, 2014 8:54 pm
by snailbrain
cassini wrote:There are quite a few things you can do:
  • Start with parameter -printtoconsole
    (works for namecoind. I'm not sure if this parameter exists in Namecoin-Qt.)
    This alone reduces the synch time substantially. A lot of time is wasted accessing the db files and the debug log file simultaneously.
    You probably want to suppress all the debug display output by sending it to /dev/null (linux, mac) or NUL (windows), e.g.
    ./namecoind -printtoconsole 1>/dev/null
  • Copy the content of an existing and already synchronized directory to your experimental directory (except wallet.dat) and use the parameters -datadir and -conf.
    By the way, I've got several synchronized directories (clones) on my machine and on external harddisks, hence I ALWAYS start namecoind with -datadir and -conf, e.g.
    /nmcdir1/namecoind -datadir=nmcdir1 -conf=nmcdir1/namecoin.conf -printtoconsole
    You need to keep two things in mind, however:
    1.) Always be aware which wallet.dat is currently in use.
    2.) If your conf file contains daemon=1 and you want to issue commands to your namecoin daemon then you have to use the same parameters, of course. For example:
    /nmcdir1/namecoind -datadir=nmcdir1 -conf=nmcdir1/namecoin.conf getinfo
    3.) If it doesn't want to synchronize to the latest blocks then stop and restart with -reindex
  • Run it on an SSD.
    Without the abovementioned tricks the synchronization time in an empty directory on a standard harddisk takes 2 days. On a SSD it's 2 hours.
    (dual-core CPU, high speed network)
Furthermore, there have been experiments with bootstrap.dat by indolering and phelix, if I recall correctly. I can't find the forum thread at the moment, and they may be out of date. The idea is you download the whole datadir content as one zip file, unzip to your datadir, and start the namecoin client with -reindex.
Any news on this? Indolering? Phelix?
thanks Cassini
-

Really, i'm looking for an actual fix for it. I'm aware of the tricks that help.. the best one is using a ram drive.
I think there must be something simple that is being missed..
There must be some explanation to exactly what is happening, yet i've not seen any posts/research explaining exactly what the problem is..

Running namecoin from scratch with a mechanical hard drive is too painful -- and of course, I would like this to be ported to huntercoin (which has the same problem except mostly magnified :) ).

The bounty, although currently not a large sum will come from the Huntercoin Development Fund.

Re: Slow Syncing Issues

Posted: Fri Apr 11, 2014 2:55 pm
by phelix
On windows some of the .dat files become badly fragmented. I think there is a fix for this for Bitcoin. This does not seem to be the whole story, though. Maybe the log files get flushed after every output?

In the current version there need two annoying debug prints to be removed. If you start with a lot of domains the log file will grow to a large size.

Also we could try switching to levelDB or a newer version of berkelyDB (database format change but should otherwise not be such a big deal). Of course the effort to do so would probably be better invested into the rebase.

Re: Slow Syncing Issues

Posted: Fri Apr 11, 2014 3:16 pm
by cassini
snailbrain wrote:There must be some explanation to exactly what is happening, yet i've not seen any posts/research explaining exactly what the problem is..
The best explanation I could find is this one for the Bitcoin client before 0.8.x:
https://bitcointalk.org/index.php?topic ... msg1111732
Also note the last post in the discussion by the same user "2112". Seems that an antivirus guard can be a third factor, after defragmentation and write-append access to db and log files.

Re: Slow Syncing Issues

Posted: Fri Apr 11, 2014 4:06 pm
by snailbrain
cassini wrote:
snailbrain wrote:There must be some explanation to exactly what is happening, yet i've not seen any posts/research explaining exactly what the problem is..
The best explanation I could find is this one for the Bitcoin client before 0.8.x:
https://bitcointalk.org/index.php?topic ... msg1111732
Also note the last post in the discussion by the same user "2112". Seems that an antivirus guard can be a third factor, after defragmentation and write-append access to db and log files.
thanks.. yes seems related to that, wonder how they fixed..

although it does seem a bit worse on windows, it does do the same on linux - only doesn't put up the windows not responding messages.
On linux you just can't click anything (in the qt) and rpc calls pause for long durations (if related)

defragging datadir definitely helps for a while, but is not a solution.

must be solveable..

Re: Slow Syncing Issues

Posted: Fri Apr 11, 2014 4:33 pm
by phelix
Of course you can also use the -dbcache option... -dbcache=500 --> 500mb ram database cache

Re: Slow Syncing Issues

Posted: Fri Apr 18, 2014 5:27 am
by domob
See also my recent post to the BDB thread. I think I've understood at least a big part of the problem and have a suggestion for how to fix it. Can be ported to Huntercoin, too, in the future.