We've had a bunch of new servers in place for around 3 months now. They seem to be working well and are performing just fine.
Then, out of the blue, our monitoring started throwing alerts on seemingly random servers. Our queues were building up – basically, database performance had dropped dramatically and our processing scripts couldn't stuff data into the DBs fast enough.
What could be causing it?
I took a quick glance at our monitoring and various statistics confirmed the problems. You can clearly see in the following graphs that CPU Wait and Load Average increased at around 14:30, and at the same time MySQL throughput and command counters dropped dramatically:




So, I've found the symptoms; what could be the cause?
Digging around in the system logs, I found the following lines (emphasis is mine):
Apr 26 12:55:31 b008 Server Administrator: Storage Service EventID: 2176 The controller battery Learn cycle has started.: Battery 0 Controller 0 Apr 26 12:56:36 b008 Server Administrator: Storage Service EventID: 2266 Controller log file entry: Battery is discharging: Battery 0 Controller 0 Apr 26 12:56:36 b008 Server Administrator: Storage Service EventID: 2248 The controller battery is executing a Learn cycle.: Battery 0 Controller 0 Apr 26 14:21:52 b008 Server Administrator: Storage Service EventID: 2278 The controller battery charge level is below a normal threshold.: Battery 0 Controller 0 Apr 26 14:21:53 b008 Server Administrator: Storage Service EventID: 2188 The controller write policy has been changed to Write Through.: Battery 0 Controller 0 Apr 26 14:21:53 b008 Server Administrator: Storage Service EventID: 2199 The virtual disk cache policy has changed.: Virtual Disk 0 (Virtual Disk 0) Controller 0 (PERC 6/i Adapter) Apr 26 14:55:06 b008 Server Administrator: Storage Service EventID: 2177 The controller battery Learn cycle has completed.: Battery 0 Controller 0 Apr 26 14:55:21 b008 Server Administrator: Storage Service EventID: 2247 The controller battery is charging.: Battery 0 Controller 0 Apr 26 14:55:21 b008 Server Administrator: Storage Service EventID: 2278 The controller battery charge level is below a normal threshold.: Battery 0 Controller 0 Apr 26 15:25:41 b008 Server Administrator: Storage Service EventID: 2279 The controller battery charge level is operating within normal limits: Battery 0 Controller 0 Apr 26 15:25:41 b008 Server Administrator: Storage Service EventID: 2189 The controller write policy has been changed to Write Back.: Battery 0 Controller 0 Apr 26 15:25:42 b008 Server Administrator: Storage Service EventID: 2199 The virtual disk cache policy has changed.: Virtual Disk 0 (Virtual Disk 0) Controller 0 (PERC 6/i Adapter) Apr 26 18:50:26 b008 Server Administrator: Storage Service EventID: 2358 The battery charge cycle is complete.: Battery 0 Controller 0
Bingo!
The RAID controller is running a battery learn cycle. When battery charge drops below a certain level, cache Write Back is disabled, and that kills disk performance. It seems this test is enabled by default and is configured to run every 90 days. Of course, Sod's law dictates that it has to trigger in our busy period!
The Dell tools are not able to turn off this feature, but the LSI MegaCli tool can (Dell PERC 6/i controllers are re-badged LSI cards). I've run the following script on all servers (thanks to burr86 on ##infra-talk @ Freenode):
#!/bin/sh TMPFILE=$(mktemp -p /tmp bbu.relearn.off.XXXXXXXXXX) || exit 1 echo "autoLearnMode=1" > $TMPFILE # or =0 to enable the bbu relearn MegaCli -AdpBbuCmd -SetBbuProperties -f$TMPFILE -a0 rm -f $TMPFILE
I wrote a puppet class to run this script on all nodes:
class megacli::check {
exec{'perc_bbu_autolearn.sh':
require => Class['megacli::install'],
cwd => '/tmp',
path => '/usr/local/bin:/bin',
unless => 'MegaCli -AdpBbuCmd -GetBbuProperties -a0 | grep -q "Auto-Learn Mode: Disabled"'
}
}
omconfig storage battery action=startlearn controller=0 battery=0
Thanks for this. I had the exact same issue and dell was no help.
Kudos on a very detail oriented diagnosis and solve.
Hello,
That's not a problem with Dell but with LSI Card.
See on web and you can see more explanations with Nec Website :
ftp://ftp2.nec-computers.com/TID0612071320/TID0612071320.doc
But Great thanks for the script.
Well, it's not actually a problem specifically with the card, whether it's the LSI version or the Dell OEM version. It's more an operational issue, ie. making sure that the battery learn process does not run when the disk subsystem is under heavy load.
Pingback: The perils of uniform hardware and RAID auto-learn cycles | PHP SPain
Pingback: The perils of uniform hardware and RAID auto-learn cycles | Weez.com
Pingback: The perils of uniform hardware and RAID auto-learn cycles | Unix Linux Windows
About 6 years ago we had this same problem, I called Dell and they even sent replacement batteries instead of explaining what it is and how to manually do it
we also faced big problems with perc6i hangs. MySQL was getting too many conns because the RAID was hanging for 2-10s with 100% util in iostat but no write/read going on. The hangs were periodic.
The cause was nagios that was checking the RAID status via megacli every hour. When issueing megacli commands, the controller will hang some random time. This seems to be a perc6i problem, because we have several other LSI controllers in production (even Intel OEMs) that don't have this problem… even when using the same megacli version.
So Dell, please fix your controller firmware… this is a pain in the ass problem! Or at least document this so other admins don't waste time.
Pingback: The perils of uniform hardware and RAID auto-learn cycles | MySQL Performance Blog
Pingback: Battery Learning still problem many years after | Weez.com
Pingback: Battery Learning still problem many years after | MySQL Performance Blog
Pingback: Battery Learning still problem many years after - MySQL Performance Blog
Thanks for this post – it's an issue I'm already aware of, but there aren't enough people writing about the pitfalls of Dell kit. We've been climbing a steep learning curve with it, even using Dell's supported Redhat versions.
Couple of points:
1 – It's not the DRAC doing these tests as per your article title, it's the RAID controller.
2 – It is, as you say, not possible to prevent them. It is, however, possible to prevent the RAID from slowing down while they're run by using the Dell tools. There's obviously an element of risk in doing so, as for a short while you'll be running with write-back caching enabled and a flat battery. To live dangerously,
omconfig storage vdisk action=changepolicy controller=0 vdisk=0 writepolicy=fwb
Pingback: Hard lesson from Dell’s PERC H700 Battery Write Cache | j0e.us
Pingback: Looking for RAID Controller without Battery Learning problems ? | Weez.com
Pingback: Slow database? Check RAID battery! | The Agile Radar
Pingback: Looking for RAID Controller without Battery Learning problems ? - MySQL Performance Blog
You just made my day by pointing me to the LSI MegaCLI tool!
The performance loss of my machines during the BBU conditioning was unacceptable. Thank you so much for this article.
shoki
Have you found any solutions to MegaCli causing the random hangs on these controllers ?
I just ran into the same issue (nagios -> check_mk -> MegaCli), and I'm wondering if it's a lost cause or there's any news since 2010.
Currently eyeing upgrading the firmwares, but don't want to trade problems I have for problems I don't yet have.
We've been bitten by this too and also learned the hard way that disabling the learn cycle does not help. In our case it seemed like the controller had a wrong estimation of battery health and it disabled write caching without warning
http://en.community.dell.com/support-forums/servers/f/906/p/19491953/20303835.aspx