How long does a supercap battery hold its charge?

Fritz

Well-Known Member
Apr 6, 2015
2,516
694
113
67
My backup server has a LSI MEGARaid SAS 9271 8i with a supercap BBU. It's running RAID 6. I normally only power it up as needed. When powered down I power it completely off via a switched PDU. Couple of questions -

1. Does the supercap maintain it's charge when the system is plugged in but not powered up?
2. If so am I jeopardizing my data by powering the server completely down and thus causing the supercap to completely lose it's charge?

TIA
 

clcorbin

New Member
Feb 15, 2014
24
1
3
More experienced people can (and will!) chime in if I am wrong, but the point of the cap is to provide just a little power to store the data in the cache so it can be written out to the disks when the system comes back up. This is only necessary if the system lost power while writing data (aka: power went out, plug was pulled, etc.). During a normal shutdown, the data is flushed before the system shuts down, so there is nothing to store.

Given that it is a cap, it will slowly drain down from both the load of powering the cache memory and from internal leakage within the cap. So yes, it will eventually run out of juice and the cached data will be lost. But this only matters IF the system was shutdown improperly while writing data to the disks.

So if you just went into the OS and told the system to shutdown, no you don't have anything to worry about because the cache was flushed properly before shutdown.
 
  • Like
Reactions: Samir

Samir

Well-Known Member
Jul 21, 2017
1,899
696
113
47
And to add this the great post above, supercapacitors are not like ordinary capacitors and do not drain out as fast. They don't hold charge as long as a battery, but they are almost as good as one in applications like this. Their real strong point is that unlike rechargeable batteries that die after so many charge/discharge cycles, a super cap can do this many more times.

At least this is how the theory goes. I looked into ultra capacitors a decade ago for a product that was to replace the batteries in electronic hotel locks. By the time the engineer I got with had figured out anything, his company wanted to steal the idea and by the time that came around the lock industry had figured out how to use a flywheel that would be activated by the door lock handle that would charge a battery/capacitor so the need disappeared. I'm glad too as that company would have made millions off my idea. :mad:
 
  • Like
Reactions: clcorbin

Fritz

Well-Known Member
Apr 6, 2015
2,516
694
113
67
So I guess the bottom line if the server loses power unexpectedly I should immediately restart it to dump the cache before it disappears into la la land.
 
  • Like
Reactions: Samir

Samir

Well-Known Member
Jul 21, 2017
1,899
696
113
47
So I guess the bottom line if the server loses power unexpectedly I should immediately restart it to dump the cache before it disappears into la la land.
Actually, even this probably wouldn't be necessary with today's drives and caching schemes where the hba will flush to the drives as fast as the drives can take it, which means it can probably get to their capacitor backed flash which writes it to nvram before it's an issue.

In general, you would want to boot up a server that suddenly and unexpectedly loses power, even if it is not used 24x7--just for it to recover gracefully. Then you can shut it down like normal without an issue.

I would expect super capacitor backed memory to last as long as battery backed memory if not longer, and I don't know if an hba implements nvram on the card to hold the flash data indefinitely (I would think some would).

And I guess it really depends on the card so I looked yours up. :) You don't have to worry about a thing as yours seems to be doing the two stage cache protection of supercapacitor and nvram:
"RAID caching is a cost-eff ective way to improve I/O performance by writing data to a controllers’ cache before it is written to disk. In write-back mode, data written to cache is vulnerable until it is made permanent on disk. To avoid the possibility of data loss or corruption during a power or server failure, Broadcom off ers the CacheVault fl ash cache protection module or the LSIiBBU09 battery backup unit for the MegaRAID SAS 9271-8i controller. CacheVault fl ash cache protection uses NAND fl ash memory powered by a super-capacitor to help protect data stored in the MegaRAID controller cache. The RAID controller automatically writes the data in cache memory to fl ash storage when a power failure occurs, while the super-capacitor keeps the current going during the process. When the power comes back, the DRAM is recovered from fl ash storage and the system goes on without loss of data. Customers have the fl exibility to choose a traditional LiON battery solution or a greener, lower total cost of ownership (TCO) cache protection solution with MegaRAID CacheVault technology."

(from Broadcom MegaRAID SAS 9271-8i | SSDworks.com)
 

Fritz

Well-Known Member
Apr 6, 2015
2,516
694
113
67
Actually, even this probably wouldn't be necessary with today's drives and caching schemes where the hba will flush to the drives as fast as the drives can take it, which means it can probably get to their capacitor backed flash which writes it to nvram before it's an issue.

In general, you would want to boot up a server that suddenly and unexpectedly loses power, even if it is not used 24x7--just for it to recover gracefully. Then you can shut it down like normal without an issue.

I would expect super capacitor backed memory to last as long as battery backed memory if not longer, and I don't know if an hba implements nvram on the card to hold the flash data indefinitely (I would think some would).

And I guess it really depends on the card so I looked yours up. :) You don't have to worry about a thing as yours seems to be doing the two stage cache protection of supercapacitor and nvram:
"RAID caching is a cost-eff ective way to improve I/O performance by writing data to a controllers’ cache before it is written to disk. In write-back mode, data written to cache is vulnerable until it is made permanent on disk. To avoid the possibility of data loss or corruption during a power or server failure, Broadcom off ers the CacheVault fl ash cache protection module or the LSIiBBU09 battery backup unit for the MegaRAID SAS 9271-8i controller. CacheVault fl ash cache protection uses NAND fl ash memory powered by a super-capacitor to help protect data stored in the MegaRAID controller cache. The RAID controller automatically writes the data in cache memory to fl ash storage when a power failure occurs, while the super-capacitor keeps the current going during the process. When the power comes back, the DRAM is recovered from fl ash storage and the system goes on without loss of data. Customers have the fl exibility to choose a traditional LiON battery solution or a greener, lower total cost of ownership (TCO) cache protection solution with MegaRAID CacheVault technology."

(from Broadcom MegaRAID SAS 9271-8i | SSDworks.com)
Thank you sir.
 
  • Like
Reactions: Samir

Stephan

Active Member
Apr 21, 2017
271
144
43
Germany
You should be ok, the supercap is just there so controller can save in-flight not yet ack'ed by all HDDs data from RAM to flash, in case the outage lasts longer (hours, days...). Supercap will leak charge and would be too flaky to trust to power DRAM which needs constant refreshing until admin can restore power. Data in that cache would be lost if this takes too long.

Incidentally ZFS was designed to handle this even without expensive controllers. All you lose is data since last commit (5 secs, if you haven't touched the default). There are no partitial writes and also there is never doubt if data read back is what really was written before or right during a crash. Not that anyone asked but I dropped all LSI MegaRAID usage years ago, because the corner cases in block storage started to really irritate me.
 

Fritz

Well-Known Member
Apr 6, 2015
2,516
694
113
67
I got the 9271 in a Quanta server I bought on eBay. I upgraded it to a 3008 HBA. Since the 9271 will do RAID 6 I decided to put it to work in my backup server. Hopefully I won't regret it in the future. I hate to see good HW sitting idle.
 
  • Like
Reactions: Samir

Samir

Well-Known Member
Jul 21, 2017
1,899
696
113
47
I stopped using RAID 5 in 1996. It just never properly addressed bit-rot which was starting to show up on the 9GB drives available at that time. These days it's either RAID1 or 0+1, but that's it. Otherwise, just jbod.
 
  • Like
Reactions: cageek

RTM

Well-Known Member
Jan 26, 2014
791
291
63
I got the 9271 in a Quanta server I bought on eBay. I upgraded it to a 3008 HBA. Since the 9271 will do RAID 6 I decided to put it to work in my backup server. Hopefully I won't regret it in the future. I hate to see good HW sitting idle.
I am saying (well writing... but you get it) this as someone who definitely should do it more often: When you have surplus hardware, you should consider selling it
Again just putting it here, because if you are anything like me, you will end up with too much hardware ;)
 
  • Like
Reactions: Samir and clcorbin

Fritz

Well-Known Member
Apr 6, 2015
2,516
694
113
67
The 9271 usually does a patrol scrub shortly after I fire it up. I assume it's looking for bit rot. It takes several hours to complete.