Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2007 17:05:23 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Christopher Key <cjk32@cam.ac.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: OT: Looking for some inpiration with UPS setup
Message-ID:  <Pine.BSF.3.96.1071111142607.2408A-100000@gaia.nimnet.asn.au>
In-Reply-To: <20071109204413.562EB16A547@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 09 Nov 2007 16:33:34 +0000 Christopher Key <cjk32@cam.ac.uk> wrote:

 > I've a FreeBSD fileserver, a solid state router (Linksys box running 
 > OpenWRT) and a couple of gigabit switches that I'd like to move onto a 
 > UPS (I'm primarily looking at the APC Smart-UPS line).
 > 
 > The requirements for the FreeBSD system are pretty simple, it's not 
 > likely to be of any use if the power's out, so after a few minutes to 
 > allow any files open over the network to be saved, it should perform an 
 > orderly shutdown and remain off until the power returns.  However, the 
 > router is a little different.  It maintains some state information in 
 > RAM (dhcp leases etc) that I'd prefer not to lose during a short power 
 > outage, and it would also be useful to retain internet access, so 
 > ideally I'd like the router and switches to stay up for as long as the 
 > battery lasts in the UPS.
 > 
 > Space and budget are limited, so ideally I'd like to achieve all this 
 > with a single UPS, which is where the problems arise.  As I understant 
 > it, when the UPS wants to wake the attached machines up, it power cycles 
 > its output.  This however will reset the router, which was what I was 
 > hoping to avoid.

Looking at the relative power requirements, I suspect your Linksys WRT
box would likely draw 12W max and perhaps a good deal less (check its
specs or measure it) whereas your server + switches might draw 10 times
that, even without a monitor staying on.  (P-166 or 3GHz quad-core? :)

Given you're using a main UPS that needs to cycle power to restart your
server (presumably powered off by 'shutdown -p +1 message for syslog'
ONO after several minutes running on UPS battery) then using a tiny UPS
to run your router separately makes good sense. 

Have a look at, for example, http://phk.freebsd.dk/soekris/ups/ which
supplies 12V for a Soekris 4501/4801 but could easily be adapted if the
Linksys isn't happy with 12VDC input.  A 12Ah SLA battery could run the
Soekris at 6W (.5A) for maybe 20 hrs.  The 250/12VAC transformer needed
is likely in a nearby junkbox as a plugpak for some external modem, or
you could use many 12-15VDC @1A unregulated supplies, which include the
transformer and the first rectifier .. even more old modems used these.

Meanwhile your larger (3-500VA?) UPS can look after your server etc.

 > I've thought around the problem for some time, but not come up with any 
 > convincing solutions:
 > 
 > 1) Use some sort of WOL command from the router to the FreeBSD system 
 > rather than having the UPS power cycle its output.  How does the router 
 > know the power's returned?  Can the UPS be set not to power cycle its 
 > power output when the power returns?

No idea about the former, and I don't know if OpenWRT could be made to
listen to the UPS and act on it - anything's possible I guess - but if
the UPS is still running when power returns, it has to cycle power to
wakeup the server somehow, or you need some sort of external swiching.

 > 2) Use a second cheap UPS to 'protect' the router whilst the primary UPS 
 > cycles its power output.  This seems rather crude, and would presumably 
 > reduce the battery life of the primary UPS due the losses in the second UPS.

As above .. if the second UPS is small, it will be relatively efficient
for its load, and can be run from the mains rather than the primary UPS. 
Anything bigger than 12Ah (or even 7Ah) for the router UPS is overkill,
and it's more efficient to run the router on DC than its plugpak anyway.

 > 3) Have the UPS wake the PC via some other means.  USB would seem to 
 > ideal choice, but the motherboard won't do a wake on USB from S5, and 
 > I'm can't find a UPS with an ethernet interface.

Some older laptops, at least, were reputed to do wake-on-serial input,
but I'm not sure if that would work with (serial) UPS wiring or not.

 > 4) KISS.  Buy two smaller, cheapers UPS units.

Or buy one, get one (nearly) free from the junkbox and a few bits from
the local electronics store.  Coopt a friendly engineering student if
you're wary about the bit of soldering or choosing components. 

Generally: don't shutdown your server too soon .. I don't know about
your situation, but here at least most blackouts, brownouts and surges
last just a few seconds, sometimes short enough to reset server A while
server B sails through, but outages more than a few minutes are much
rarer (and are then likely to last perhaps hours).  Sometimes power will
come back for a few seconds then quit again, and you don't want too much
stop/start, so if you can persuade your UPS to wait for a minute or so
of good power before cycling its output back on, so much the safer. 

Cheers, Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1071111142607.2408A-100000>