[comp.unix.i386] Sustained throughput to disk - DOS

neese@adaptex.UUCP (07/27/90)

>/* ---------- "Sustained throughput to disk - DOS" ---------- */
>>STUFF DELETED<<
>Without going into too much detail, the program uses a large memory buffer
>(actually you can specify the size), which is initialized with data bytes,
>and then repeatedly written to disk files using the [unbuffered] write()
>function.  The program uses a default buffer size of 32 Kbytes.
>
>Running the program in DOS, I can achieve sustained throughput to the disk
>of about 600-800 Kbytes/sec (486/25 Microchannel w/ SCSI host adapter).
>This allows me to fill a 640 Mbyte disk (MAXTOR 8760, formatted) in about
>15 minutes.
>
>The same program, running on UNIX, appears to be capable of "bursting" at
>600-1000 Kbytes/sec, but does terrible in sustained throughput; less
>than 100 Kbytes/sec.  It takes HOURS to fill a 640 Mb disk under UNIX.
>Am I doing something incredibly stupid (UNIX-wise) in the program?
>
>In DOS the output files are opened with:
>    open(filename, O_CREAT|O_TRUNC|O_RDWR|O_BINARY, S_IREAD|S_IWRITE)
>UNIX is almost the same, but without O_BINARY:
>    open(filename, O_CREAT|O_TRUNC|O_RDWR, S_IREAD|S_IWRITE)
>In both DOS and UNIX the buffer (32 Kbytes) is repeatedly written with:
>    write(filename, buf_ptr, bufrsize)
>inside a fairly tight 'for' loop that only does error checking on the
>return value from the write() function call.
>
>Any comments, suggestions and/or "let me point out your stupidity"'s would
>be greatly appreciated.  Thanks in advance.

Regardless of the size of the writes you are requesting, the operating system
is going to break them apart into whatever the filesystem resolution is.  You
didn't say which UNIX you are using or SCSI adapter either.  So for giggles
and grins I tried the same thing (approximated as you didn't post source)
on my 25Mhz/386 AT w/AHA-154xB adapter and Wren VII drive under SCO XENIX and
got about 250KB per second.  XENIX should not be that good as all writes are
done in BSIZE (1K) increments no matter what size the request.
Bottom line:  It all depends on the OS, driver, adapter, drive, and CPU on
the performance.  BTW, on DOS this same setup got 900KB/sec using the same
test.  I haven't gotten my ISC yet, but have heard that it will do 800KB/sec
pretty consistently.

			Roy Neese
			Adaptec Senior SCSI Applications Engineer
			UUCP @  uunet!swbatl!texbell!
				  {nominil,merch,cpe,mlite}!adaptex!neese