From owner-freebsd-scsi@FreeBSD.ORG Fri Oct 27 22:04:56 2006 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4C7416A415 for ; Fri, 27 Oct 2006 22:04:56 +0000 (UTC) (envelope-from ken@nargothrond.kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C8A843D4C for ; Fri, 27 Oct 2006 22:04:54 +0000 (GMT) (envelope-from ken@nargothrond.kdm.org) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.13.6/8.13.6) with ESMTP id k9RM4pjn079299; Fri, 27 Oct 2006 16:04:51 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.13.6/8.13.6/Submit) id k9RM4pVj079298; Fri, 27 Oct 2006 16:04:51 -0600 (MDT) (envelope-from ken) Date: Fri, 27 Oct 2006 16:04:50 -0600 From: "Kenneth D. Merry" To: Martin Cracauer Message-ID: <20061027220450.GA78909@nargothrond.kdm.org> References: <20061027214011.GB86642@cons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061027214011.GB86642@cons.org> User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.88.1/2126/Fri Oct 27 07:48:55 2006 on nargothrond.kdm.org X-Virus-Status: Clean Cc: freebsd-scsi@freebsd.org Subject: Re: Why is SCSI so much faster with the write cache off (than ATA)? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 22:04:57 -0000 On Fri, Oct 27, 2006 at 17:40:22 -0400, Martin Cracauer wrote: > I have observed it several times and I am missing one bit of knowledge > here: > > why is SCSI so much faster when you turn off the write cache than > P-ATA and SATA? > > P-ATA and SATA crumble to about 1/10th of the speed (just writing one > file with 8k blocks linear), whereas SCSI just loses 10-20%, for me. > I have observed that 10 years ago with some 8 GB ATA IBM disk on the > BX chipset versus some 4 GB Quantum Atlas, and now I see it again with > Seagate 7200.7s and .8s versus a 10K Compaq labled 36 GB drive. > > Personally I don't see why a linear write should be slow at all. > Surely the computer delivers the data fast enough for sectors to be > filled as they pass under the head. Maybe the ATA disks lose one > rotation per sector or per filesystem block written anyway? Then why > don't SCSI disks lose the same way given they are not allowed to cache > anything either? I would probably look at the tagged queueing behavior on both drives for an answer. With write caching turned off, the only way to get more than one transaction down onto the disk is tagged queueing. 10 years ago, ATA disks didn't do tagged queueing, but SCSI disks did. So if you have enough commands outstanding, the drive can maintain decent throughput putting them out on the disk. Without it, you have to wait for the head to get into position and the sector to come around to start writing. Once you're done writing, you have to wait for the initiator to send another request down. Now, SATA disks have tagged queueing and also NCQ. In theory those should work well. Is tagged queueing enabled on the ATA disks you're testing? Is it the old-style queueing or NCQ? Ken -- Kenneth Merry ken@kdm.org