Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

3. UPS Basics

3.1. How To Select A UPS

UPSes are nowadays very inexpensive. In the U.S. in 2006, quite capable ones are available for less than $100, and prices are heading down. In fact prices are so low now that we're not going to walk you through the elaborate optimization step that would have been important even two or three years ago, of estiming the watt dissipation of your computer and matching it to a UPS rating. Instead we'll explain why this would be a waste of effort and how to buy in a simpler and more effective way.

Warning

Bear in mind that the UPS systems that you're likely to buy in a store or computer catalog are not intended for safety or life-critical equipment. These devices should be considered to be pieces of consumer electronics. As such, the number-one basis on which most of these devices compete with each other is on price, not quality.

Cost-effectiveness is more important to UPS vendors (because it appears to be more important to their customers) than ultimate reliability. If your life depends on computer uptime, you need a special purpose, online, big, redundant, expensive system. These systems are beyond the scope of this document. When you buy a UPS at your local computer store, you are not buying this sort of system.

UPSes are rated by the watts a full battery can put out before it drains. However, they are marketed using a VA (voltage-amps) figure; often, consumer-grade UPSes don't even specify a wattage on the box where you can see it. This is because the VA figure is larger and looks sexier. As a rule of thumb. assume the wattage is half of the VA rating; for an explanation of the complexities involved (if you care) see the white paper Understanding Power Factor, Crest Factor, and Surge Factor on the APC website.

But even if you know the watt rating of the UPS, it is the ratio of that figure with the wattage dissipation of your computer that controls the dwell time. Your dissipation is hard to predict; it can even be effected by things like the size of monitor you use (big ones can be quite power-hungry).

Manufacturers try to get around this technical thicket by putting an expected dwell time on the box. But they exaggerate and even lie about their dwell times a lot (this is called "marketing"). What they'll do is quote you the dwell time you would get driving a bare minimum system with the disk drives shut off and a tiny monitor, in much the same way laptop manufacturers lie about their battery dwell times. The more honest UPS manufacturers give you a little table showing expected dwell times for different system configurations ("desktop", "tower", etc.). As a rule of thumb, assume you will get about 50% of the dwell time listed on the box for your configuration type.

My advice is to forget the numbers game. Just go online or to your local computer store and buy one of the higher-end consumer or home-office models from APC, Best, Tripp-Lite, Belkin, or some other reputable manufacturer. Go ahead and grab the model with the longest dwell time, highest watt rating, or biggest VA number you can find; the premium for it is not likely to be more than $75 over the bargain-basement model. I guarantee you will feel very good about your decision not to pinch pennies come your first extended power outage.

Perhaps a more compelling reason it is better to over-buy capacity rather than ending up with a UPS that is too weak for your power drain is that overstrained UPSes can fail in ugly ways, including catching fire and exploding.

Be sure you get a line interactive UPS rather than the older standby or SPS type. The older technology doesn't actually filter your power through the battery, so you're not assured of good voltage conditioning. The main advantage of an SPS (low cost) has been eroded now that line-interactive UPSes are so inexpensive. There are other UPS types, but they are either obsolescent or targeted at large data-center installations. For a detailed discussion of the different UPS types, see The different types of UPS systems, a white paper on the APC site.

Another important consideration is how your UPS will communicate with your computer. Do not buy a serial line UPS (one that communicates via an RS-232C cable). These are passing out of use in favor of UPS designs that use USB or Ethernet, for the very excellent reason that RS-232C interfaces are flaky, difficult to configure, and difficult to debug. Ethernet is overkill for this application; UPSes simply don't need that kind of bandwidth. We recommend sticking with USB, which is well-matched in price/performance to this job and relatively easy to troubleshoot.

Until recently there was an important distinction between smart and dumb UPSes. Dumb UPSes did voltage-level signaling through individual pins; smart ones used the link as a primitive character channel and could pass more status information over it. But if you avoid RS232C UPSes you will never see a dumb one; indeed, it is likely that by the time you read this no dumb UPses will be in production any longer.

Some UPSes advertise that they deliver a sinusoidal waveform. Those that don't may be delivering something more like a square wave or a very noisy sine wave. There are differing schools of thought about how important this is. One school of thought holds that one should always run equipment on the best approximation of sinusoidal input that one can, and that deviations produce harmonics which may either be interpreted as signal if they get through a power supply, or may actually damage the equipment. Another school holds that since almost all computers use switching-type power supplies, which only draw power at or near the peaks of the waveforms, the shape of the input power waveform is not important.

Who's right? We don't know. Nick's opinion is that sinusoidal output is worth the extra money, especially for on-line UPS systems that continually provide their waveform to the computer; Eric is inclined to doubt it matters much with modern power supplies. If you don't know that your equipment has a switching-type power supply, you certainly might want to think twice before buying a low quality UPS.

Personally, I (Eric) like APC UPSes (nether Eric nor Nick has any connection with the company). But this is not the kind of widget for which manufacturer makes a whole lot of difference as long as you stick with one of the reputable brands.

3.2. Deploying your UPS and other devices: the total picture

Our recommendation for a production Unix environment is a configuration like the following:

  1. An UPS for the computer system.

  2. Surge suppression on all phone lines, and also on serial/parallel lines that leave the room.

  3. Line conditioners on any devices not connected to the UPS. If you do take a power hit, it's cheaper to replace a $50 line conditioner than a $1500 laser printer.

If this is too expensive for you, then downgrade the UPS to a line conditioner like the TrippLite. But don't go without at least that. Running unprotected is false economy, because you will lose equipment to electrical storms — and, Murphy's Law being what it is, you will always get hit at the worst possible time.

One thing to note is that you typically shouldn't put a laser printer on the brownout-protected sockets in a UPS — toner heaters draw enough current to overload a UPS and cause a shutdown within seconds. Modern UPSes generally have some plugs that are marked surge-suppressed but not filtered through the battery; plug your printer into one of those.

A UPS should be wired directly to (or plugged directly into) the AC supply (i.e. a surge suppressor is neither required nor suggested between the wall and the UPS). In addition, a surge suppressor between the UPS and the equipment connected to it is redundant.

3.3. Software Assistance

Your UPS communicates with your computer so it can gracefully shut the computer down when an outage has lasted too long for the battery to cope. In order for graceful shutdown to actually happen, your computer needs to have a background process — a daemon, in Unix terms — watching whatever messages come over the UPS cable for the one that says terminate. Then it needs to tell the operating system to shut down.

Your UPS probably comes with a CD full of such software. Throw it away, as (a) most of it will be useless bits written for Windows systems, and (b) in the unlikely event you get Linux software it will almost certainly be stale binaries for a version you don't run.

Back in the days of dumb serial-line UPses, there used to be about half a dozen different open-source UPS monitor daemons: apcd, dumbupsd, genpowerd. powerd, smupsd, usvd and more. These were fairly stupid programs for a simple job. Many required you to hand-wire a custom RS232C cable to get around various evil things that UPS manufacturers did to their ports in order to lock in customers.

Those days are gone. USB UPSes get rid of the cable-hacking and hardware klugery, but require a bit more smarts from a monitor daemon. Accordingly the field has narrowed considerably. There appear to be only two such projects left standing.

The Network UPS Tools project is a generic UPS monitor daemon that aims to communicate intelligently with all current UPS designs.

apcupsd is a daemon specifically designed for communicating with UPSes made by APC, the American Power Corporation.

Both are solid, well-run projects. Their development groups are mutually friendly, and there has been occasional talk of a merger. Awkwardly, the apcupsd project is in many ways the more featureful of the two, with, among other things, better USB support and better documentation — but the NUT tools have a cleaner architecture, more developers, and acceptance in Red Hat and other major distributions.

My advice is simple; run apcupsd if you buy an APC UPS, and the NUT tools if you buy anything else. RPMs and Debian packages (which will modify your system's boot sequence appropriately as well as installing the daemon binaries) are available for both, so installation should be easy either way.

3.4. Preparing Your System For Auto-Reboot

If you are using your UPS to try to keep a DNS/Web/mailserver up 24/7, you will want to make sure the machine can be configured to boot automatically when it is powered up.

This is not the normal behavior of most computers as shipped from the factory. Normally after the power is cut and restored, you must explicitly press a button for the power to actually be turned on. You can test your computer by powering it down; shutting off the power (pull the plug); then plugging the cord back in. If your computer immediately starts up, good. There is nothing more to do.

If your computer does not start up, manually turn on the power (by pressing the power on button) and enter your computer's SETUP program (often by pressing DEL during the power up sequence; sometimes by pressing F10). You must then find and change the appropriate configuration parameter to permit instant power on.

Normally, this is located under the BOOT menu item, and will be called something such as Restore on AC/Power Loss or Full-On. The exact words will vary according to the ROM BIOS provider. Generally you will have three options: Last State, Power On, and Power Off.

Some BIOSes do not support such an option. This is idiotically bad design, but it does happen. If so, your only practical remedy is to get a new motherboard.