[mythtv-users] PostgreSQL

chris at cpr.homelinux.net chris at cpr.homelinux.net
Mon Jul 3 18:41:41 UTC 2006


On Mon, Jul 03, 2006 at 06:35:43AM -0600, Brian Wood wrote:
> > Serial is just as or more reliable.
> Serial is probably more reliable, but what I discovered when looking  
> at buying was that the ones with serial interfaces very often don't  
> have the "smarts" to give info like minutes remaining, hence my  
> statement that using USB is best.

The other issue I ran into once is that while USB is USB is USB, 
serial is whatever the UPS manufacturer wants it to be.  In the 
case of the older APC units, the serial port was 9-pins but 
non-standard.  If you plugged a standard serial cable into that 
port the UPS would shut off immediately.  APC wanted you to spend 
extra to get a custom cable, and refused to tell anyone what the 
pin-outs were (although obviously someone simply cut open one of 
their special cables and told us all what was inside).

When I got my newer UPS I got one with USB.  It just works.

> > It's a pvr I don't want to spend $150 on a UPS for it, I'm guessing  
> > the
> > $60 one I'm going to buy will last about 5-7 minutes, good enough for
> > power flickers, but most outages are 5-10 minutes plus around here.  
> > But
> > the reality is that I should not have to worry my pvr powers down.

And if you get a UPS that's supported by the Linux daemon then you 
don't have to worry.  You can specify the shutdown parameters using 
either time remaining or percentage remaining (for those units that 
can provide that information) or use a count-down timer.

Some of the smarter UPS units will accept a power-off command from 
the computer (to save the remaining battery after Linux has shut 
down) and then automatically come back on once the power is 
restored.  If you set your BIOS' APM settings correctly then your 
PC will come on and boot Linux automatically.

When it comes to the UPS, remember that a CRT will represent more 
than 50% of the power drain.  If your PVR is connected to a TV and 
the TV is not on the UPS then your power draw is actually quite 
low.  My back-end runs headless (I have a separate front-end 
machine elsewhere) so the UPS powers only the CPU, router and 
cable-modem.  According to the daemon, I can easily survive more 
than 30 minutes on battery.

> I think you have to worry about *any* PC powering down unexpectedly  
> these days, certainly anything storing perhaps hundreds of gigabytes  
> of information. I think even a typical Windows XP "consumer" machine  
> will have problems with a power failure.

Don't fall into the trap of thinking that a journalled filesystem 
will save you.  Yes, it will prevent filesystem corruption, but it 
doesn't help at all where things like lock files exist or 
non-transactional file edits are in progress.  Applications have to 
be able to clean up after themselves.

That's one of the places where Postgres used to have a real edge 
over MySQL.  I haven't checked lately, but MySQL used to silently 
ignore the SQL transaction statements.  The mysqlcheck that runs 
when the system boots is good at catching schema errors caused by 
power outages (like broken indexes) but complex database updates 
are easily broken.

> I certainly don't have the database experience that you do, but the  
> few times I've had a test Myth system crash I've never lost the mysql  
> DB, of course this was just a small test box with very little data,  
> I've never run my production machine on direct commercial power.

Even with a UPS you have to be prepared for a few messy cleanup 
jobs.  I used to have kernel panics because of a hardware problem, 
and while mysqlcheck usually found no errors there were a few times 
when it did.  The mythcommflag program did a good job of cleaning 
it up.  I've never "lost the database" as a result of an unplanned 
shutdown.



More information about the mythtv-users mailing list