you can add cheap offline UPS if the sole purpose is to clear the peaks and provide
at leats a couple of minutes of online time,just buy the cheapest ones
or you can use
https://www.amazon.com/gp/product/B003Y24DEU for example
it won't be able to keep all five miners online but will provide surge protection and level the peaks
I like APC UPS but their 1500 VA units will not handle even a SINGLE Antminer S9, T9, R4, or S7.
900 or so max WATT rating (the 1500 VA capability is for use with older non-power-factor-corrected computer power supplies).
It WOULD handle a single S5 comfortably, or a PAIR of them will handle a S9 if you are using 2 separate power supplies to power the S9 with.
In the APC line, you'd have to go to at least one of their 2000 VA units (which do NOT come cheap unless you get them used with dead batteries) to handle even a SINGLE S9 running on a single PS.
Nice thing about APC models - they ALL have current-limited charge circuits (going back to their ORIGINAL models decades back), so you can replace the small batteries they are designed for with car-type or deep cycle HIGH capacity batteries very easily - and a pair of good CAR batteries will commonly last 5-10 years on a APC 1500VA unit, while only costing commonly 2-3 times what that pair of 12V 7AH or 12V 12AH gel-cell batteries (depending on the specific APC 1500VA model) the units are designed for cost AND give a lot higher capacity and run time.
There is no such thing as "level the peaks" outside of some ferro-resonant UPS designs - and those things tended to cause issues of their own outside of some fairly narrow specific design setups, as well as tending to be VERY large and heavy for comparable capacity.