From owner-freebsd-current@FreeBSD.ORG Fri Dec 25 14:03:08 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B439010656C1; Fri, 25 Dec 2009 14:03:08 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 1E7898FC28; Fri, 25 Dec 2009 14:03:07 +0000 (UTC) Received: by fxm27 with SMTP id 27so8840276fxm.3 for ; Fri, 25 Dec 2009 06:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=R2BJlZNHt3AdKWRU5CjVdwHNBknRyMYX3YkeFXpqZFg=; b=PVkmPU+1PctRe78u4jal5YkdiqjvgBzbQqt7gNRmhqrP1vJvWEzs8cjFhyuRZnvIpE jzVXYfdZo44LiCwmkKetWPICSZUw9U7/ZJ0Jd2UgW+chClU+6LtFS624z4Wv+l+NOU1v pmTaohyXCHS60CEvbEWgMY6rZvhdYX31rlDnU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=EgdinLOY749Ydsq4tWqSZI7SixhvO/l5hOp9pC/wD8c6xdE1sg9fv5Oq2CwkHm8E34 9y/GAj1W0lAuSHVisZY6uDPfitqieBido6kokHAQi3z3utFLC9g3NorozDR8E4aHUIyR A0Gm5Zw4iEhmvaztvw36Ease7ivY2rmDpZOxM= Received: by 10.223.62.11 with SMTP id v11mr4553173fah.60.1261749787066; Fri, 25 Dec 2009 06:03:07 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 13sm3185428fxm.5.2009.12.25.06.03.05 (version=SSLv3 cipher=RC4-MD5); Fri, 25 Dec 2009 06:03:06 -0800 (PST) Sender: Alexander Motin Message-ID: <4B34C619.7070505@FreeBSD.org> Date: Fri, 25 Dec 2009 16:03:05 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Poul-Henning Kamp References: <27357.1261741202@critter.freebsd.dk> In-Reply-To: <27357.1261741202@critter.freebsd.dk> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-arch@FreeBSD.org Subject: Re: File system blocks alignment X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 14:03:08 -0000 Poul-Henning Kamp wrote: > In message <4B349ABF.2070800@FreeBSD.org>, Alexander Motin writes: >> The difference is quite significant. Unaligned RAID0 access causes two >> disks involved in it's handling, while aligned one leaves one of disks >> free for another request, doubling performance. > > You will find RAID5 writes to be an even better test: Optimal filesystem > block-size is a RAID5 stripe width, and if you do not get the offset > right you instantly loose at least 50% of your write bandwidth. My > practical experience says oftem more like 75% is lost. Sure, I just had no trusted RAID5 nearby to do benchmark. Actually with RAID5 situation is even more complicated, as there are actually two optimal transaction sizes: - First is a stripe size - amount of data written sequentially to one disk. If you are not aligned with it, it give same results as I have just shown. - Second is a row size - stripe size * number of data disks. You may freely read less information then full row, but short write cause RAID to handle read-modify-write scenario. If you have 3 disks and no battery backed cache - you will definitely loose. But if there are 15 disks and good cache, I believe ability to execute multiple requests independently in parallel will compensate penalty. Also with 15 disks it would impractical to increase FS block size, as in that case OS will have to do that read-modify-write instead of controller and you may loose even more. With RAID5 I think best practice would be to align FS to the stripe size and instruct it to write data in maximal bursts, in best case - full row at a time. -- Alexander Motin