A couple people have already send me helpful suggestions, asking for
information that I really should have included in my first post.
First off, m. allan noah <[EMAIL PROTECTED]> writes:
> a 192 meg bonnie test is useless when you have 128 megs of ram. try a
> bonnie test of 1 gig and that will be more useful.
>
> of course- bonnie is a pointless benchmark, only good for showing how
> fast your system can run bonnie :)
Since linux cacheing and buffering is still a little mysterious to me, I
gave his suggestions a try. Here are the updated bonnie results:
-------Sequential Output-------- ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
md0 192 5933 86.4 15222 21.8 4172 11.8 5672 81.3 9014 11.2 218.4 4.6
sda 192 6411 92.0 15072 18.5 4265 11.7 5760 80.6 12069 13.1 201.8 4.5
sdb 192 6480 92.7 15434 20.4 4273 11.8 5843 82.3 12376 13.2 213.2 3.8
md0 1000 5365 78.2 12196 18.7 4340 12.5 6213 89.5 8820 11.3 78.0 2.5
sda 1000 5700 81.2 12157 16.4 4316 11.6 6331 88.2 12160 12.9 69.7 2.2
The contribution of the cache is certainly smaller with a 1 GB size;
write perfomance is now the same as read performance in unmirrored use,
which makes much more sense.
But it looks like the results are still pretty much consistent; the RAID-1
mirror is a smidgen slower on writes, a little faster on seeks, but much
slower on reads. And although I agree that benchmarks should be taken
with a grain of salt, I think they're useful in this limited context.
The other set of hints came from Bill Ellis <[EMAIL PROTECTED]>:
> My guess is you'll get better RAID1 performance if you crank up your
> chunk size. Your raidtab shows that you were using a 4k chunk size.
> Try cranking that up quite a bit (e.g. 32k, 64k, or 128k).
>
> You might also try using a larger e2fs block size [...]
>
> I'm told that the blocksize multiplied by the "stride" factor should match
> your chunk size, so theabove would be for 64k chunksize...
I have tried a variety of chunk sizes without much luck. Chunk sizes of
1 and 2 are forbidden; 4, 8, 16, 32, 64, and 128 yield similar bonnie
scores.
Although increasing the e2fs blocksize to, say, 4096, certainly does
increase bonnie scores, I don't think I can do that in my case. This
filesystem will be filled with files whose average size is around 1600
bytes. Although I tried a variety of -f and -i numbers with mke2fs,
I couldn't get anything close to the number of inodes I need with any
blocksize over 1024 bytes.
In other putzing around, I came across one really, really weird result
that may give someone a clue. When I first build a mirror set, the
driver does the synchronization in the background, allowing the device
to be used. If I run a bonnie test while the the mirror set is still
resyncing, it is *faster* than when the mirror set is synced. Here's
the (slightly edited) output:
[root@venus local]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 sdb6[1] sda7[0] 8353664 blocks [2/2] [UU] resync=8% finish=28.9min
unused devices: <none>
[root@venus local]# bonnie -s 192
-------Sequential Output-------- ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
1* 192 5743 83.5 15856 23.8 4107 12.4 5643 80.4 12166 15.5 223.4 5.0
[root@venus local]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 sdb6[1] sda7[0] 8353664 blocks [2/2] [UU] resync=55% finish=8.6min
unused devices: <none>
[root@venus local]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 sdb6[1] sda7[0] 8353664 blocks [2/2] [UU]
unused devices: <none>
[root@venus local]# bonnie -s 192
-------Sequential Output-------- ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
1* 192 5757 85.2 15765 23.3 4284 12.8 5677 82.2 8792 10.5 238.8 5.3
Thus, for maximum performance it looks like I should break my mirrors. :-)
Thanks, everyone, for looking at this! I really appreciate the help.
William