svn: stable/8/sbin/geom/class/mirror

Alexander Motin mav at FreeBSD.org
Sat Dec 12 18:20:49 PST 2009


Will Andrews wrote:
> On Thu, Dec 10, 2009 at 05:47:37PM -0800, Maxim Sobolev wrote:
>> Alexander Motin wrote:
>>> Author: mav
>>> Date: Thu Dec 10 23:51:24 2009
>>> New Revision: 200373
>>> URL: http://svn.freebsd.org/changeset/base/200373
>>>
>>> Log:
>>>   MFC r200282, r200290:
>>>   Change gmirror default balance algorithm from "split" to improved "load".
>>>   "split" is very ineffective for devices with rotating media as HDDs.
>>>   To be effective, it needs that transfer time reduction due to block
>>>   splitting was bigger then access time increase due to non-sequential
>>>   access. For modern HDDs I was able to reproduce it only with read sizes
>>>   of 2MB and above, which is almost not applicable in real life.
>>>   "load" algorithm same time is more universal and effective now.
>> The other problem with real hard drives is that they usually read much 
>> more data than requested. Some suggest that they read as much as one 
>> track each time the data is not in cache even if one sector has been 
>> requested, therefore splitting request of any reasonable size is 
>> meaningless, as it would simply cause both drives to load essentially 
>> the same data, wasting half of available I/O bandwidth and in addition 
>> you cause both heads to do seek, which makes it even worse.
> 
> Indeed.  I think the benchmarks speak for themselves.  The new algorithm
> results in much lower average I/O service time, due to the seek time
> reduction by dispatching read requests to providers according to the known
> distance from the request, and also reduced by taking advantage of the disk
> cache.  The disk cache size probably affects how close the requests need to
> be for optimal selection, so perhaps a sysctl is warranted to allow
> administrative adjustment of this value from mav@'s default of 1MB.

I've took 1MB not from cache, but from track size. I've divided read
speed of modern drive on number of RPMs. I doubt that disk will read
more then one track ahead, and same time it is quite probable to read
whole current track, as head is already there and caches are quite large
now.

Sure it can be made tunable, but I think it is not very important, if
you won't build mirror of floppy disks. Even in worst case current
algorithm will give load disbalance no more then 1 request, as distance
is only a hint, not a strict rule.

-- 
Alexander Motin


More information about the svn-src-all mailing list