Subject: HD I/O (was: Re: Various..)
To: NetBSD-Amiga <amiga@netbsd.org>
From: Geert Uytterhoeven <Geert.Uytterhoeven@CS.kuleuven.ac.be>
List: amiga
Date: 11/16/1994 10:27:46
> Here's what I get on my A3000 (25MHz030, Quantum PD1225S, 18MB RAM, NetBSD 1.0)
> 
>   gonzo# dd if=/dev/rsd1e of=/dev/null count=1000
>   1000+0 records in
>   1000+0 records out
>   512000 bytes transferred in 6 secs (85333 bytes/sec)
> 
> The default block size for dd is only 512 bytes (which is probably why
> we see the low transfer rates).  Try bumping the block size up to 4K,
> 8K, 16K, and .......  Some pretty decent numbers show up when you do
> that...  (I'd be interested in knowing what values you get from
> increasing the block size :-) )
> 
> Using: dd if=/dev/rsd1e of=/dev/null count=1000 bs=_____
> 
>    Block Size         Transfer rate
>    ----------      -------------------
>         4096          682666 bytes/sec
>         8192         1170285 bytes/sec
>        16384         1820444 bytes/sec
>        32768         2184533 bytes/sec
>        65536         2520615 bytes/sec 

So I thought it was time for a quick comparison between NetBSD and Linux/68k...

My test machine:

	A4000/040
	2 MB CHIP
	12 MB FAST (not completely used by NetBSD and Linux/68k due to MapROM)
   SpeedRamsey enabled (+12% RAM speed).
	IDE Conner CP-30544 (master) + Seagate ST-3144A (slave)

I tested with a 115 MB partition on the fastest drive (the Conner).

  o Test operating systems:

      - NetBSD 1.0 beta 2 (sorry, no real 1.0), 11.5 MB FAST used

      - Linux/68k 0.9pl3, 11 MB FAST used

  o Test command:

      dd if=/dev/rsd0h of=/dev/null count=1000 bs=<Block size>

  o Results:

      Block size     Xfer rate (NetBSD, b/s)     Xfer rate (Linux/68k, b/s)
      ----------     -----------------------     --------------------------
          512             170666                      445217
         4096             682666                      611343
         8192            1170285                      362638
        16384            1260307                      372194
        32768            1489454                      376471
        65536            1560380                      378100

  o Comments:

      - NetBSD seems to be faster, except for small blocks

      - I used `sync' in between the test commands under NetBSD to invalidate
        the diskcache (seemed to work), for Linux `sync' didn't seem to flush
        read caches, so I tested in reverse order to make sure nothing usable
        was left in the cache.

      - Running the test with 4K blocks a second time without sync under
        NetBSD didn't matter, while it boosted the Linux read performance from
        611343 b/s to 1031738 b/s.

      - Linux uses all available memory for caching, which is slower for large
        reads (copy-to-cache time, cache page management), but greatly
        improves small reads. It's not unusual to have 8 MB memory used for
        caching on a 12 MB system. In fact, running `make' on an already
        compiled kernel source tree twice shows you a fantastic speed up
        during the second pass, even if you changed some source files.

      - I forgot to write down some results under AmigaOS, but if I remember
        correct, I got on the same disk (ScsiSpeed 4.2):

          Block size    Xfer rate (b/s)
          ----------    ---------------
              512            700000
             4096           1000000
            +8192          +1800000

        which shows that AmigaOS disk I/O isn't that slow :-)
        
Now I'm waiting for a comparison of SCSI disk performance...

Greetings,

						Geert

+--------------------------------------------------------------------+
| Geert Uytterhoeven -->> Wavelets, Amiga, MultiUser, Linux/68k,...  |
| Geert.Uytterhoeven@CS.kuleuven.ac.be                               |
| Dept. of Computer Science, Katholieke Universiteit Leuven, Belgium |
+--------------------------------------------------------------------+
  Click!