As a (non-scientific) test (this is my lap-top just browsing the web & all):
Code:
> dd if=Video/IT_CONQUERED_THE_WORLD.AVI of=/dev/null bs=1m
700+1 records in
700+1 records out
734490624 bytes transferred in 51.388414 secs (14292923 bytes/sec)
So that gives us a sort-of baseline (although it seems really slow).
Then we make a file & such:
Code:
> dd if=/dev/zero of=tmp/trash.file bs=4m count=250
250+0 records in
250+0 records out
1048576000 bytes transferred in 23.669224 secs (44301241 bytes/sec)
> sudo mdconfig -a -t vnode -f tmp/trash.file
md0
Now, let us shuffle some stuff around:
Code:
> dd if=Video/Aaltra.avi of=/dev/null bs=1m
661+1 records in
661+1 records out
693546428 bytes transferred in 16.508841 secs (42010607 bytes/sec)
That was 3x as fast . . . weird (really, what? this is closer to the speed I was expecting from experience, but prefetching? did I spill beer on it?).
& again, while it's read into memory, send it to the md0:
Code:
> sudo dd if=Video/Aaltra.avi of=/dev/md0 bs=1m
dd: /dev/md0: Invalid argument
661+1 records in
661+0 records out
693108736 bytes transferred in 29.082156 secs (23832784 bytes/sec)
Now, what happens when we put a filesystem on the memory device and write (the already cached movie) to it?
Code:
> sudo bsdlabel -w /dev/md0
> sudo newfs /dev/md0a
/dev/md0a: 1000.0MB (2047984 sectors) block size 16384, fragment size 2048
using 6 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
160, 376416, 752672, 1128928, 1505184, 1881440
> sudo mount /dev/md0a /mnt/temp
> sudo dd if=Video/Aaltra.avi of=/mnt/temp/aaltra.avi bs=1m
661+1 records in
661+1 records out
693546428 bytes transferred in 26.833470 secs (25846319 bytes/sec)
Doesn't seem to be a lot of overhead in ufs . . . ?!
Okay, well, away with the
md(4) and a couple of more passes with already cached information:
Code:
> sudo umount /mnt/temp/
> sudo mdconfig -d -u 0
> dd if=Video/Aaltra.avi of=tmp/aaltra.avi bs=1m
661+1 records in
661+1 records out
693546428 bytes transferred in 15.745293 secs (44047857 bytes/sec)
4G of memory is nice:
Code:
> dd if=Video/IT_CONQUERED_THE_WORLD.AVI of=/dev/null bs=1m
700+1 records in
700+1 records out
734490624 bytes transferred in 1.167399 secs (629168492 bytes/sec)
> dd if=Video/Aaltra.avi of=/dev/null bs=1m
661+1 records in
661+1 records out
693546428 bytes transferred in 0.947022 secs (732344609 bytes/sec)
And, you know, I deleted the md0 file before I remembered to test reading from it. [red]So much for SCIENCE.[/red]
Anyway, it looks to me like the
md(4) is slow, but not horrible. It doesn't seem to me to affect system I/O by dint of existing, though.
Anyway, it's swap, and I'm not sure what you're doing that's causing so much swapping that the I/O performance is important, but I'll not judge.