From owner-freebsd-current Thu Aug 7 21:27:37 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA20549 for current-outgoing; Thu, 7 Aug 1997 21:27:37 -0700 (PDT) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA20536; Thu, 7 Aug 1997 21:27:25 -0700 (PDT) Received: (from root@localhost) by dyson.iquest.net (8.8.6/8.8.5) id XAA02012; Thu, 7 Aug 1997 23:27:19 -0500 (EST) From: "John S. Dyson" Message-Id: <199708080427.XAA02012@dyson.iquest.net> Subject: Re: IDE vs SCSI was: flags 80ff works (like anybody doubted it) In-Reply-To: from Atipa at "Aug 7, 97 10:08:44 pm" To: freebsd@atipa.com (Atipa) Date: Thu, 7 Aug 1997 23:27:18 -0500 (EST) Cc: dyson@FreeBSD.ORG, ggm@connect.com.au, current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > The main advantage with SCSI is the speed of the drive; not the > interface. Typically SCSI drives are 5400RPM at worst, and IDEs are > 5400RPM at best. I do not see IDE drives getting those 7-8ms seek times > either. Good seeks for IDE are 10ms, roughly 30% slower than SCSI. > > Doing a very crude benchmark: > $ time dd if=/dev/zero of=/tmp/file1 bs=1024 count=20000 > $ time dd if=/tmp/file1 of=/dev/null bs=1024 count=20000 > $ time dd if=/tmp/file1 of=/tmp/file2 bs=1024 count=20000 > I certainly don't disagree that SCSI drives are generally better. However, IDE's are very very inexpensive. Here is an interesting benchmark: This is the result of my "slow" recent, but not the latest, greatest IDE drive (WD 4GB drive.): Command overhead is 88 usec (time_4096 = 348, time_8192 = 607) transfer speed is 1.57828e+07 bytes/sec dd if=/dev/rwd1 of=/dev/null count=1600 bs=64k 1600+0 records in 1600+0 records out 104857600 bytes transferred in 10.881267 secs (9636525 bytes/sec) This is the result of my Hawk, SCSI drive, with an NCR 815 interface: Command overhead is 845 usec (time_4096 = 2071, time_8192 = 3297) transfer speed is 3.34201e+06 bytes/sec dd if=/dev/rsd0 of=/dev/null count=1600 bs=64k 1600+0 records in 1600+0 records out 104857600 bytes transferred in 27.336979 secs (3835742 bytes/sec) Looks like the command overhead of the IDE drive is very low. In fact, I doubt that an Atlas-II or a WD Enterprise with an AHA2940 will do much better than 200usec. Sure, tagged command queuing, etc will make SCSI under load out-perform an IDE system -- however, 4GB for about $300 is very tempting. A good 4GB SCSI drive that has the 30% higher performance that you suggest would cost at least $600, right? A WD Enterprise, a Seagate Barracuda, or Quantum Atlas-II costs at least that... /* * I think that BDE wrote this: */ #include #include #include #include #include #define ITERATIONS 1000 static int syserror(const char *where); static long timeit(int fd, char *buf, unsigned blocksize); int main(int argc, char **argv) { char buf[2 * 4096]; int fd; long time_4096; long time_8192; if (argc != 2) { fprintf(stderr, "usage: %s device\n", argv[0]); exit(1); } fd = open(argv[1], O_RDONLY); if (fd == -1) syserror("open"); time_4096 = timeit(fd, buf, 4096); time_8192 = timeit(fd, buf, 8192); printf("Command overhead is %ld usec (time_4096 = %ld, time_8192 = %ld)\n", (time_4096 - (time_8192 - time_4096)) / ITERATIONS, time_4096 / ITERATIONS, time_8192 / ITERATIONS); printf("transfer speed is %g bytes/sec\n", 4096 * ITERATIONS * 1000000.0 / (time_8192 - time_4096)); exit(0); } static int syserror(const char *where) { perror(where); exit(1); } static long timeit(int fd, char *buf, unsigned blocksize) { struct timeval finish; int i; struct timeval start; if (read(fd, buf, blocksize) != blocksize) syserror("read"); if (gettimeofday(&start, (struct timezone *)NULL) != 0) syserror("gettimeofday(start)"); for (i = 0; i < ITERATIONS; ++i) { if (lseek(fd, (off_t)0, SEEK_SET) == -1) syserror("lseek"); if (read(fd, buf, blocksize) != blocksize) syserror("read"); } if (gettimeofday(&finish, (struct timezone *)NULL) != 0) syserror("gettimeofday(finish)"); return (finish.tv_sec - start.tv_sec) * 1000000 + finish.tv_usec - start.tv_usec; }