Why is SCSI so much faster with the write cache off (than ATA)?

Kenneth D. Merry ken at kdm.org
Fri Oct 27 22:04:57 UTC 2006


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 at kdm.org


More information about the freebsd-scsi mailing list