From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 8 15:54:39 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655471065674; Wed, 8 Jul 2009 15:54:39 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojteks.tensor.gdynia.pl (wojteks.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 73A808FC15; Wed, 8 Jul 2009 15:54:37 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::2]) by wojteks.tensor.gdynia.pl (8.14.3/8.14.3) with ESMTP id n68FtBSM050761; Wed, 8 Jul 2009 17:55:11 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3) with ESMTP id n68Ft8Qp001940; Wed, 8 Jul 2009 17:55:08 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.3/8.14.3/Submit) with ESMTP id n68Ft8ak001937; Wed, 8 Jul 2009 17:55:08 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Wed, 8 Jul 2009 17:55:07 +0200 (CEST) From: Wojciech Puchar To: Ivan Voras In-Reply-To: Message-ID: References: <995877b70907080042he7aee18m22f9d4a0e4b18bef@mail.gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Regarding IO to disk X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 15:54:39 -0000 > > Declared average latency for desktop hard drives (see > http://www.seagate.com/docs/pdf/datasheet/disc/ds_barracuda_7200_12.pdf) is latency is average time to wait until data will be below head. it's by average half on single rotation. for 7200 rpm drive it's 120rps so half rotation takes 1/240 second=about 4ms. But to perform I/O you have to - send a request to disk (<1ms) - move head - depends of distance, up to 20-30ms, 8-10ms average on most drives - wait for latency - 4ms average. you end in 13-15ms average. in case of multiple parallel accesses - drive accept writes immediatelly, and can accept multiple reads if it can NCQ/TCQ, then it internally sort request queue to minimize required head moves and rotational waiting, so under high load you may go to 6-7ms/request which is about 150IOPS. Of course i'm talking about random/pseudorandom reads, multiple reads of sequential addresses will be optimized by drive. One more - i'm talking about raw I/O, FreeBSD of course optimizes filesystem acces internally by using lots of caching (as much as available memory) and planning requests. small writes to file usually succeed immediatelly (to cache).