Date: Thu, 7 Aug 1997 23:27:18 -0500 (EST) From: "John S. Dyson" <toor@dyson.iquest.net> To: freebsd@atipa.com (Atipa) Cc: dyson@FreeBSD.ORG, ggm@connect.com.au, current@FreeBSD.ORG Subject: Re: IDE vs SCSI was: flags 80ff works (like anybody doubted it) Message-ID: <199708080427.XAA02012@dyson.iquest.net> In-Reply-To: <Pine.BSF.3.91.970807215005.4224A-100000@dot.ishiboo.com> from Atipa at "Aug 7, 97 10:08:44 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
>
> 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 <sys/types.h>
#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#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;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708080427.XAA02012>
