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:

CPU Usage

Load average

MySQL Network Traffic

MySQL Command Counters

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"'
    }
}
All that remains to be done is to put a cron job in place that runs the battery learning cycle every three months at an off-peak time. The command to kick that off is:
omconfig storage battery action=startlearn controller=0 battery=0

22 thoughts on “Dell DRAC BBU auto-learn tests kill disk performance

  1. 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.

  2. Pingback: The perils of uniform hardware and RAID auto-learn cycles | PHP SPain

  3. Pingback: The perils of uniform hardware and RAID auto-learn cycles | Weez.com

  4. Pingback: The perils of uniform hardware and RAID auto-learn cycles | Unix Linux Windows

  5. 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

  6. 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.

  7. Pingback: The perils of uniform hardware and RAID auto-learn cycles | MySQL Performance Blog

  8. Pingback: Battery Learning still problem many years after | Weez.com

  9. Pingback: Battery Learning still problem many years after | MySQL Performance Blog

  10. Pingback: Battery Learning still problem many years after - MySQL Performance Blog

  11. 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

  12. Pingback: Hard lesson from Dell’s PERC H700 Battery Write Cache | j0e.us

  13. Pingback: Looking for RAID Controller without Battery Learning problems ? | Weez.com

  14. Pingback: Slow database? Check RAID battery! | The Agile Radar

  15. Pingback: Looking for RAID Controller without Battery Learning problems ? - MySQL Performance Blog

  16. 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.

  17. 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.

  18. Did this change recently? I am trying to set autoLearnMode=1 on an LSI Logic / Symbios Logic MegaRAID SAS 1078 in a Dell 1950 with MegaCli64 Version 8.07.08 (from Feb 2013) (also tried 8.07.10 from May 2013). The command fails most of the time saying “Adapter 0: Set BBU Properties Failed.”. Sometimes (as in 1 out of 20 times maybe) the command succeeds but the setting is unchanged. Is there a new way of setting this or does anyone have a version information about his megacli that can actually perform this operation? Thanks!

  19. Update: updating the controller firmware helped. Old version was V. 6.0.2-0002, new version is 6.3.1-0003. Now works as described.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required