266
submitted 9 months ago by padook@feddit.nl to c/selfhosted@lemmy.world

I woke up this morning to a text from my ISP, "There is an outage in your area, we are working to resolve the issue"

I laugh, this is what I live for! Almost all of my services are self hosted, I'm barely going to notice the difference!

Wrong.

When the internet went out, the power also went out for a few seconds. Four small computers host all of my services. Of those, one shutdown, and three rebooted. Of the three that ugly rebooted some services came back online, some didn't.

30 minutes later, ISP sends out the text that service is back online.

2 hours later I'm still finding down services on my network.

Moral of the story: A UPS has moved to the top of the shopping list! Any suggestions??

top 50 comments
sorted by: hot top controversial new old
[-] Kuinox@lemmy.world 115 points 9 months ago* (last edited 9 months ago)

When you are bored, backup a VM then hard kill it and see if it manage to restart properly.
Software should be able to recover from that.
If it doesn't, troubleshoot.

[-] Deebster@programming.dev 17 points 8 months ago

That reminds me of Netflix's Chaos Monkey (basically in office hours this tool will randomly kill stuff).

[-] BlackAura@lemmy.world 11 points 8 months ago

When I built my home server this is what I did with all VMs. Learned how to change the start up delay time in esxi and ensured everything came back online with no issues from a cold built.

Rip VMware.

load more comments (12 replies)
[-] lemmyvore@feddit.nl 40 points 9 months ago

IMHO you're optimizing for the wrong thing. 100% availability is not something that's attainable for a self-hoster without driving yourself crazy.

Like the other comment suggested, I'd rather invest time into having machines and services come back up smoothly after reboots.

That being said, an UPS may be relevant to your setup in other ways. For example it can allow a parity RAID array to shut down cleanly and reduce the risk of write holes. But that's just one example, and an UPS is just one solution for that (others being ZFS, or non-parity RAID, or SAS/SATA controller cards with built-in battery and/or hardware RAID support etc.)

[-] pezhore@lemmy.ml 19 points 9 months ago

I agree that 99.999% uptime is a pipedream for most home labs, but I personally think a UPS is worth it, if only to give yourself the option to gracefully shut down systems in the event of a power outage.

Eventually, I'll get a working script that checks the battery backup for mains power loss and handle the graceful shutdown for me, but right now that extra 10-15 minutes of battery backup is enough for a manual effort.

[-] shnizmuffin@lemmy.inbutts.lol 9 points 9 months ago

Some of the nicer models of UPS have little servers built in for remote management, and also communicate to their tenants via USB or Serial or Emergency Power Off (EPO) Port.

You shouldn't have to write a script that polls battery status, the UPS should tell you. Be told, don't ask.

load more comments (2 replies)
[-] CameronDev@programming.dev 37 points 9 months ago

Did the services fail to come back due to the bad reboot, or would they have failed to come back on a clean reboot? I ugly reboot my stuff all the time, and unless the hardware fails, i can be pretty sure its all going to come back. Getting your stuff to survive reboot is probably a better spend of effort.

[-] padook@feddit.nl 16 points 8 months ago

I didn't mean to imply that Services actually broke. Only that they didn't come back after a reboot. A clean reboot may have caused some of the same issues because, I'm learning as I go. Some services are restarted by systemctl, some by cron, some....manual. This is certainly a wake up call that I need standardize and simplify the way the services are started.

[-] CameronDev@programming.dev 17 points 8 months ago

We've all.committed that sin before. Its better to rely on it surviving the reboot than to try prevent the reboot.

Also worth looking into some form of uptime monitoring software. When something goes down, you want to know about it asap.

And documenting your setup never hurts :D

[-] nimmo@lem.nimmog.uk 5 points 8 months ago

On the uptime monitoring I've been quite happy with uptime kuma, but... If you put it on the same host that's down... Well, that's not going to work :p (I nearly made that mistake)

load more comments (3 replies)
load more comments (1 replies)
[-] fuckwit_mcbumcrumble@lemmy.world 12 points 9 months ago

Yeah an unclean reboot shouldn’t break anything as long as it wasn’t doing anything when it went down. I’ve never had any issues when I have to crash a computer unless it was stuck doing an update.

[-] Static_Rocket@lemmy.world 26 points 9 months ago

I present to you the holy hardware compatibility table:

https://networkupstools.org/stable-hcl.html

Anything not listed there is not worth buying.

[-] Deebster@programming.dev 18 points 8 months ago

A general tip on buying UPSes: look for second hand ones - people often don't realise you can just replace the battery in them (or can't be bothered) so you can get fancier/larger ones very cheap.

[-] elucubra@sopuli.xyz 9 points 8 months ago

Also, a larger capacity one is better, and it's likely you'll find a secondhand one with more capacity/features for a similar price.

load more comments (2 replies)
[-] AnarchistArtificer@slrpnk.net 17 points 8 months ago

Though I wonder if even besides adding an uninterruptible power supply (UPS) (writing acronym out for anyone else who would've had to Google it), this might be a useful exercise recovering from outages in general. This is coming from someone who hasn't actually done any self hosting of my own, but you saying you're still finding down services reminds me of when I learned the benefit of testing system backups as part of making them.

I was lucky in that I didn't have any data loss, but restoring from my backup took a lot more manual work than I'd anticipated, and it came at an awkward time. Since then, my restoring from backup process is way more streamlined.

[-] HaywardT 16 points 8 months ago
[-] BreakDecks@lemmy.ml 22 points 8 months ago

My favorite part about using an old laptop as a 24/7/365 plugged-in server is the anticipation of when the lithium battery will explode from overcharging.

[-] skilltheamps@feddit.de 45 points 8 months ago

"overcharging" doesn't exist. There are two circuits preventing the battery from being charged beyond 100%: the usual battery controller, and normally another protection circuit in the battery cell. Sitting at 100% and being warm all the time is enough for a significant hit on the cell's longetivity though. An easy measure that is possible on many laptops (like thinkpads) is to set a threshold where to stop charging at. Ideal for longetivity is around 60%. Also ensure good cooling.

Sorry for being pedantic, but as an electricial engineer it annoys me that there's more wrong information about li-po/-ion batteries, chargers and even usb wall warts and usb power delivery than there's correct information.

load more comments (3 replies)
[-] heisenbug4242@lemmy.world 6 points 8 months ago* (last edited 8 months ago)

If you say it quickly enough it may sound plausible to some but this is not how battery technology works, as explained by @skilltheamps@feddit.de

load more comments (1 replies)
[-] recapitated@lemmy.world 12 points 8 months ago

I'm a big fan of running home stuff on old laptops for this reason. Most UPSs give you a few minutes to shut down, laptops (depending on what you run) could give you plenty of extra run time and plenty of margin for a shutdown contingency.

[-] Drewelite@lemmynsfw.com 9 points 8 months ago

Small, good value, quiet, power efficient, built in battery backup and server terminal. Laptops are dope for home labs!

[-] JoMiran@lemmy.ml 12 points 9 months ago

A UPS should always be your first or second purchase if only for power conditioning and brown-out protection.

[-] atzanteol@sh.itjust.works 4 points 8 months ago

You should buy a UPS if those things are concerns for you. If not, then don't.

load more comments (3 replies)
[-] piefedderatedd@piefed.social 10 points 9 months ago
  • UPS, good idea.

  • backups too.

[-] Swarfega@lemm.ee 10 points 9 months ago

This is why I gave up self hosting. It's great when it works but it just becomes an expensive second job. I still have Plex/Jellyfin etc but for emails and password vaults I just pay for external services.

[-] cypherix93@lemmy.world 16 points 9 months ago

if you don't want it to feel like a second job, you could always quit your first!

[-] padook@feddit.nl 11 points 8 months ago

I could have the best self hosted setup.... living in a van, down by the river!

[-] atmur@lemmy.world 6 points 8 months ago

I like to host as many services as possible and I’m fine with it being a second job at times since this is my main hobby, but I actually agree with you on your examples. The three things I won’t self-host are:

  1. Emails - I am not willing to put in the effort on this. Plus, my ISP blocks those ports so I’d already be into using a VPS even if I wanted to host this. I’d rather just pay someone else, like Proton.

  2. Password manager - I actually did self-host Bitwarden for a long time, but after thinking about it for a while, I decided to take the pay someone else approach here too. I’m pretty sure I’m doing everything correctly, but I’m not a security expert. I’d rather be 100% sure my passwords are in safe hands rather than be 95% sure that I’m doing everything right on this one.

  3. Lemmy - I’ve heard about (luckily never seen) CSAM attacks on Lemmy/Kbin and will not risk that kind of content being downloaded because I’m federated with an instance dealing with those attacks. I’m happy to throw a couple bucks at lemmy.world’s Patreon and let them handle that.

load more comments (1 replies)
[-] ChojinDSL@discuss.tchncs.de 9 points 9 months ago

UPS with usb allows you to configure a script to properly shutdown your server when a power outage happens and the UPS battery is about to run out.

[-] pezhore@lemmy.ml 9 points 9 months ago

This is why I have about five of these bad boys: CyberPower CP1500PFCLCD.

One is in my utility room for my cable modem and our chest freezer, three back up my homelab and wifi AP, and one is for my office.

They've been bulletproof through storms, and when we've lost power, but not Internet I can't keep on working.

The big thing to look for is number of battery+surge outlets vs just surge outlets. Typically they top out at 1500VA - the more overhead for what you're powering, the longer you can go without mains power.

A screen/display is helpful for at-a-glance information like expected runtime, current output, etc.

[-] Catsrules@lemmy.ml 4 points 8 months ago

Never heard of someone using a UPS on a Fridge/Freezer. Does it make a difference? Seems like the UPS would just died after 10-20 minutes and not really make much difference to your freezer.

load more comments (1 replies)
[-] Appoxo@lemmy.dbzer0.com 8 points 8 months ago

Not APC. (At least for Windows) trashy software.

[-] Moonrise2473@feddit.it 6 points 8 months ago

It doesn't need the software, it gets recognized by the system as a battery

load more comments (3 replies)
load more comments (4 replies)
[-] Shimitar@feddit.it 7 points 8 months ago

I use a laptop and external jbod covered with a low power ups. As other said, the point is to bridge powergaps now long term working powerless. I live in the countrisied, so small powergaps happens specially when my photovoltaic don't produce (no, i have no battery accumulators, too expensive)

[-] cyborganism@lemmy.ca 7 points 9 months ago

Yeah if you self host, a UPS is very important.

[-] anamethatisnt@lemmy.world 6 points 9 months ago

Figure out how much power your servers use on average with the help of a wattage meter, then enter that number and how many minutes battery backup you want in Eatons UPS Power Calculator to find a suitable unit. I'm sure other vendors have similar tools too.

[-] mhredox@lemmy.world 3 points 8 months ago

Exact same thing happened to me the other day. Like exactly. Maybe we live in the same area.

load more comments
view more: next ›
this post was submitted on 03 Mar 2024
266 points (96.8% liked)

Selfhosted

40403 readers
201 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS