Massive CPU load during disk access on LSI MegaRAID

Asked by Jo Shields

I have built a server box using Ubuntu 6.06.1 AMD64, on a machine with an Intel Pentium-D 830 and 8 Samsung Spinpoint disks behind an LSI MegaRAID SATA 300-8X hardware RAID controller.

Unfortunately, disk access (reads and writes) is very slow, and CPU load average shoots through the roof over a very short period of time. For example, below is output from "vmstat 5" whilst running "dd if=/dev/zero of=/tmp/foo bs=256k". CPU load average increased steadily throughout.

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
0 0 236 437348 88 467212 0 0 0 0 252 65 0 0 100 0
 0 0 236 437348 88 467212 0 0 0 6 253 59 0 0 100 0
 0 3 244 9836 64 895160 0 0 57 88287 1680 2001 0 18 56 25
 1 3 244 9092 32 896136 0 0 16 135714 2434 588 0 18 46 36
 1 2 244 9300 32 895688 0 2 18 134610 2438 633 0 18 48 34
 0 3 244 10060 32 895012 0 0 17 138650 2467 557 0 18 48 34
 0 3 244 9820 32 895100 0 0 18 137083 2466 1153 0 19 37 44
 0 3 244 9924 32 895156 0 0 16 137735 2438 487 0 19 48 33
 1 4 244 10056 32 894840 0 0 34 133923 2412 590 0 18 44 37
 2 2 244 9076 32 895848 0 0 16 140427 2504 584 0 18 48 33

Much of the CPU time seems to be spent in IOWait, according to top. Any suggestions would be gratefully received.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jo Shields
Solved:
Last query:
Last reply:
Revision history for this message
Alex Muntada (alex.muntada) said :
#1

I've been observing this same issue with with MegaRAID hardware since a couple of years ago. The controller I had trouble with is an INTEL RAID SRCS16 (which is actually a LSI MegaRAID SATA 150-6).

Some tests with RedHat Enterprise Linux and Debian GNU/Linux testing/unstable kernels performed much better that Desktop installations as Fedora Core, so my suggestion is to get a try to Ubuntu Server (I could not at that moment). The server kernels have many performance enhancement that can be very valuable in I/O bottleneck issues as the one that seems the case with MegaRAID.

Besides, you can give a try to software RAID too, which has been much more tested than MegaRAID drivers and gives a fair performance in most cases. However, if performance is a huge requirement in your environment, I'd consider switching to less troublesome hardware.

Revision history for this message
Alex Muntada (alex.muntada) said :
#2

Did you had the chance to test the MegaRAID with Ubuntu Server?
Is there anything else that we can do to help you?

Revision history for this message
Best Jo Shields (directhex) said :
#3

Fiddling with the controller settings brought things largely under control - iowait is still high under heavy I/O, but performance is about right now, and load average never gets obscenely high anymore

Revision history for this message
Alex Muntada (alex.muntada) said :
#4

Providing the details about which controller setting you fiddled with would be appreciated, so other users that may be suffering performance issues with megaraid controller in the future can benefit from your experience.

Thanks!

Revision history for this message
boernieat (brausch) said :
#5

could you please provide your controller settings, becaus i am using the same controller with ubuntu 7.04 server and suffer from the same problems you mentioned above.

it would be great if you would do that!!

thank you very much!!

Revision history for this message
boernieat (brausch) said :
#6

sorry, double post but i thought i should give some infos on my machine and the output from vmstat with the same dd command...

asus p5b-vm do
intel core 2 duo, sockel 775, 1.86ghz, 2mb-cache
2x 1gb corsair pc2-6400u ddr2-800mhz
intel srcs16 (6-port sata raid 5 controller)
4x seagate barracuda 7200.9 200gb, in a raid 5

here ist the output from "vmstat 5" while running "dd if=/dev/zero of=/tmp/foo bs=256k"

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r b swpd free buff cache si so bi bo in cs us sy id wa
 0 4 236 50580 127868 1735600 0 0 11 1 6 7 1 5 90 5
 0 4 236 50996 127756 1735124 0 0 0 2867 146 96 0 1 50 49
 0 4 236 151944 127708 1633516 0 0 0 3277 150 146 0 1 50 49
 0 4 236 135576 127724 1649892 0 0 0 3277 150 141 0 1 50 49
 0 4 236 123300 127736 1662188 0 0 0 2867 145 132 0 0 50 50
 2 4 236 111024 127752 1674468 0 0 1 2458 143 126 0 1 50 50
 0 4 236 90192 127772 1694956 0 0 0 3264 151 121 0 1 50 49
 0 4 236 77792 127784 1707244 0 0 0 2458 142 126 0 0 50 50
 0 4 236 65268 127800 1719532 0 0 1 3277 147 134 0 0 50 50
 0 4 236 51652 127800 1732808 0 0 0 2867 146 134 0 1 50 49
 0 4 236 50408 127744 1733952 0 0 0 3277 153 128 0 0 50 50
 0 4 236 173496 127736 1610292 0 0 0 2867 144 130 0 1 50 49
 0 4 236 161220 127748 1622564 0 0 0 2458 144 131 0 0 50 50
 0 4 236 148944 127760 1634868 0 0 0 3277 147 146 0 0 50 50
 0 4 236 132328 127776 1651244 0 0 0 2854 148 147 0 0 50 50
 0 4 236 119804 127788 1663540 0 0 0 3277 153 135 0 1 50 49
 0 4 236 99096 127808 1684020 0 0 0 3277 148 147 0 1 50 49
 0 4 236 86572 127824 1696308 0 0 1 2867 147 144 0 1 50 49
 0 4 236 74048 127836 1708596 0 0 0 2458 140 130 0 0 50 50
 0 4 236 53340 127856 1729076 0 0 0 2867 146 143 0 1 50 49
 0 4 236 52092 126960 1731008 0 0 0 2867 148 149 0 1 50 49

i thank everyone for any help!!!

Revision history for this message
Jo Shields (directhex) said :
#7

I think the logical volume settings were for Writeback/Adaptive/Direct IO

Setting a larger stripe size might help too - the 64KiB default is very very small by today's standards, 256KiB might help (it has on some of our kit at work)

Revision history for this message
boernieat (brausch) said :
#8

thank you for the fast reply, but how did you set this?

i am not that firm with linux and google couldn't answer my questions this far. if you could write a little bit more details that would help me very much!!

another question is: i have productive data on this machine and as far as i know changing those settings would imply a format of the volume. is this right or can i set these options with data on the volume?

thank you!

Revision history for this message
Jo Shields (directhex) said :
#9

Stripe size can only be set when creating the volume

The other parameters can be changed using the LSI BIOS during boot, or using the MegaMgr utility from lsi.com

Revision history for this message
Ralf (ralf-bergamin) said :
#10

I'm experienced the same problem:

CPU: Intel C2QUAD Q6600
Mem: Kingston 4GB
Mainboard: Asus P5WDG2 WS Professional

LSI Megaraid 150-4
- 1x WD Raptor 150GB RAID 0
LSI Megaraid 150-4
- 3x Hitachi 400GB RAID 5

NIC: 2x DUAL Intel E1000

Transfer rate to the WD Raptor is approx 15MB/S, and to the RAID 5 it's 6MB/s.
I'm using Ubuntu Server 7.04 with WMware installed. One VM is Openfiler with the RAID 5 attached.

Unfortunately I can't find a solution on the net.

The Stipesize is indeed set to 64kb.

Offtopic: In the past (on different hardware) I've created a software RAID 5 with Openfiler and with transfer rates of 35MB/s, but with a very high (60%) cpu utilization.

Revision history for this message
Sven Tegethoff (cheetah-tigress) said :
#11

Okay, it's been a few weeks, but maybe this helps:

By default, some cards have their write cache disabled! This leads to a crawlingly slow write performance, and will result in lots of waiting processes and a seemingly high system load.

The easiest way to change the write cache policy is by using "megamgr" (downloadable from lsi.com). Go to the "objects" menu and then "logical drives". Select the first logical drive and then "change settings". Then change the write cache policy for your logical drives from "Write-Through" to "Write-Back". The change will be effective immediately.

(If you don't want to install megamgr, there's probably also some way to set this parameter using megarc, but please don't ask me how ... :) )

yours,

Sven

Revision history for this message
boernieat (brausch) said :
#12

thank you for your comment!!

i had made this setting after directhex post and the performance now is much better but the raid is still slow when writing data.

do you have another tipp what we could do to boost performance?

iI've desidered to change the stripe size to 256k and make my server "new" after full backup. what do you think about this?

yours,
boernieat