Two identical hosts: MySQL sucks, Oracle doesn't
807557May 1 2008 — edited May 5 2008I have two mostly identically configured V440s with internal disks, the only difference is that one has SUN72G ST373297LC internal disks and the other has SUN146G ST314670LC internal disks. The internal disks are mirrored together with SVM. The internal disks are shared with the OS and swap. There is virtually no paging activity on either system - in fact I removed all on-disk swap devices just to make sure all paging was in memory. Each disk's file system is configured as one big slice in the disks, and the databases share this big root filesystem with the OS.
The big difference is that the host with the 73G disks is running an application plus an essentially write-only MySQL database with MyISAM tables (InnoDB disabled) and the host with the 146GB disk is running Oracle 9-something. There is a big difference in CPU consumption, however - the MySQL host's app is consuming about 50% of CPU, and the Oracle host about 10% - so the MySQL host is paging and context switching, but none of that spawns disk IO as far as I know (remember I have removed all on disk swap devices)
The problem I am seeing is that the host with MySQL/73G disks has insanely high disk service times and is almost fully blocked on IO, as opposed to the Oracle system where the same amount of IO is accomplished with virtually no service queues or blocking.
Examples (output of iostat -xn md/dXX 60):
Oracle host:
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 57.9 0.0 463.4 0.0 0.5 0.3 8.5 2 31 md/d10
MySQL host for approximately equal IO amount:
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.4 56.5 3.5 525.5 0.1 10.7 2.3 187.9 13 26 md/d1
and
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.2 77.2 1.9 718.5 0.2 25.1 2.6 324.6 17 35 md/d1
The MySQL host, worst case, can totally block the disk for only modest IO rates::
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
1.6 272.5 12.5 2920.1 0.8 255.5 3.0 932.1 82 100 md/d1
As you can see the MySQL database starts to hose the disk at only modest IO rates. I'm not a DBA, but is MyISAM always this badly behaved? I've tuned the key cache up to 1GB, and the cache is not yet full. AFAIK that's the only tunable in MyISAM that might make a difference.
Unfortunately the app is a piece of junk (Aprisma Spectrum) over which I have no control, it has not even been ported to X86 yet. Of course, I can always move the tables to an external array, but I should not have to buy a $10K RAID array to get decent performance from a system that is only trying to write 3 or 4MBytes/sec.
Any ideas? I am afraid we are going to have to to drop tens of $K on external arrays so we can stripe the filesystem for this DB.