(S)ATA performance in FBSD 6.2/7.0

Eric Anderson anderson at freebsd.org
Fri Mar 2 13:35:16 UTC 2007


On 03/02/07 06:03, Alexander Leidinger wrote:
> Quoting Cheffo <cheffo at FreeBSD-BG.org> (from Fri, 02 Mar 2007 13:38:45 +0200):
> 
>> Hi,
>>
>>
>> Ted Mittelstaedt wrote:
>>> ----- Original Message ----- From: "O. Hartmann"   
>>> <ohartman at zedat.fu-berlin.de>
>>> To: <freebsd-performance at freebsd.org>; <freebsd-questions at freebsd.org>
>>> Sent: Friday, March 02, 2007 1:38 AM
>>> Subject: (S)ATA performance in FBSD 6.2/7.0
>>>> The last days I tried to figure out why some of my lab's FreeBSD   
>>>> boxes and also mine at home seem to be outperformed by some Linux   
>>>> setups around here and I saw something interesting.
>>>>
>>> blah blah blah deleted
>>>
>>>> Before digging into this problem deeper with benchmarks, could   
>>>> anyone explain why FreeBSD reaches this 33 MB/s limit (sounds like  
>>>>  UDMA 33
>>> man mount
>>>
>>> read section on "async"
>>>
>>> linux by default mounts async
>>>
>>> freebsd by default mounts sync
>>>
>>> you can change FBSD to async
>>>
>>> then watch your fs scramble during a power failure
>>>
>>> no big deal, it's only your data.
>>>
>>> Ted
>> If SYNC is default how can you explain this:
>>
>> [12:58]root at hater:~# mount
>> /dev/ad4s3a on / (ufs, local, synchronous)
>> devfs on /dev (devfs, local)
>> /dev/ad4s3d on /tmp (ufs, local, soft-updates)
>> /dev/ad4s3f on /usr (ufs, local, soft-updates)
>> /dev/ad4s3e on /var (ufs, local, soft-updates)
> [...]
>> So I'm pretty sure that for type ufs async is default.
> 
> Both of you are wrong. By default "noasync" is used. This is different  
> from sync and async. Feel free to look up the difference.
> 
>> Also I do not see why sync should report different speeds for copy and
>> benchmark tools if they do the same thing?
> 
> Because cp may behave differently than the tools used to benchmark. A  
> dd may be more portable in this case.
> 
>> Just to be sure I added to my /tmp entry async in /etc/fstab:
>> /dev/ad4s3d             /tmp            ufs     rw,async     2       2
>>
>> umounted and mounted again and still have:
>> /dev/ad4s3d on /tmp (ufs, local, soft-updates)
> 
> IIRC when SU is used, async is not used even if specified. But I' not  
> sure about this.
> 
> 
> Asides from the linux async-by-default there's maybe also the  
> write-cache-off penalty in FreeBSD. But I'm not sure it is off by  
> default. I disable the WC myself in loader.conf everywhere to be on  
> the safe side and I don't feel like experimenting ATM (I'm ill in bed).
> 
> If the same conditions are tested in FreeBSD and linux (which is not  
> easy, as we don't share a common FS implementation, even when we  
> support the same FS type) and the sync/async and WC related stuff can  
> be ruled out, it may be a problem in the (S)ATA code and it would be  
> nice if we would know about this. So please dig deeper into this (it  
> can also be a problem with our cp or GEOM or whatever).


People should not be using file system tools to measure hardware speeds 
like SATA or disks.  That doesn't make sense, since a portion of that 
benchmark would then include the file system, which as you mention is 
very very different between OS'es.  cp shouldn't be used.  dd is ok for 
bare minimum testing I suppose.

On one of my SATA memory disks, I can get 125MB/s through it, with no 
extra magic.

Eric






More information about the freebsd-performance mailing list