Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2011 13:28:21 -0700
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.ORG>,  "current@freebsd.org" <current@FreeBSD.ORG>
Subject:   Randomization in hastd(8) synchronization thread
Message-ID:  <4DD2DA65.5060103@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi Pawel,

I am trying to use hastd(8) over slow links and one problem is apparent 
right now - current approach with synchronizing content sequentially is 
not working in this case. What happens is that hastd hits the first 
frequently updated block and cannot make any progress anymore. In my 
case I have 30GB of dirty space to be synchronized over just 1mbps uplink.

The quick fix that I've applied is randomization in the block selection 
code. This way  eventually all least used blocks will be synchronized, 
leaving only hot ones dirty. More effective approach would be to use 
some kind of LRU selection algorithm, but statistical approach would 
work just as good in this case.

Please review the patch below:

http://sobomax.sippysoft.com/activemap.c.diff

The next thing to make it usable is to make "async" mode working. I 
think simple support for that mode can be easily implemented by not 
sending write request to the remote note at all, but instead just doing 
it locally and kicking the synchronization thread to do it's magic in 
the background. I hope to follow up with the patch soon.

-Maxim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DD2DA65.5060103>