this post was submitted on 14 Jul 2024
54 points (96.6% liked)

Selfhosted

39980 readers
768 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 1 year ago
MODERATORS
 

I'm new to selfhosting and I find myself rarely using the server, only when I need to retrieve a document or something.

I was thinking of implementing something to make it power on, on demand, but I'm not sure if this might be harmful for the HDDs, and I'm not sure how to implment it if so.

What's your recommendation to do so? I'm running a dell optiplex 3050

top 26 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 3 months ago* (last edited 3 months ago) (1 children)

I built a system ground up with a focus on power-usage a few years ago. You can go far down the rabbit hole when you start googling, but the key take-aways for me are:

  • Eliminate features you don't really need. E.g. do you realy need a RAID 10 configuration with 4 disks? Or can you get by with 2, or maybe even 1 (which might mean you experience downtime while waiting for a new HDD, but you do keep backups right?).
  • Standard 300-400w ATX power supplies are inefficient under low loads (meaning much AC goes to waste converting it to DC). Use a PicoPSU (or a motherboard that runs on DC). Search for a high-quality power adapter (e.g. Leicke) that's rated for low loads. Just make sure your PSU can handle booting, when your system will draw much more.
  • Install drivers for motherboard features you don't need (like soundcards or wifi) and then switch them off in the OS as this usually sets them in a more power-efficient state rather than disabling them in BIOS.
  • SSD's use less power than HDD's but get expensive for higher capacities. I use a Nvme SSD as a startup drive and to host my containers, and 2,5" 5400rpm HDD's for storage. Those disks are slow but get the job done, and despite running 24/7 there hasn't been any failures.
  • I installed a passive cooling-block on the CPU and optimized the airflow in the case. It has 3 (small, as it's a 1u server case) case fans that are controlled by fancontrol and only kick in when the cpu's temp is > 60°C, which is not very oten. This also means it's very quiet ;-).
  • Make sure to configure all power settings in the OS of your choice (powertop and tlp for linux).
[–] [email protected] 3 points 3 months ago (1 children)

Great tips. I hunted 2.5" HDDs when I was doing my build but they seem to be on their way out, being meant for laptops which are now largely just using SSDs :(

[–] [email protected] 1 points 3 months ago

I used to buy external Seagate HDD's and pry open the enclosure. Inside it's just a regular 2,5" HDD with a small sata>usb board. Last time I checked these are still available and might be easier to find (and cheaper). But yeah, you don't have many models to choose from these days. You could use SSD's which will save a bit of power but they are vastly more expensive. I don't think the money you'll save on power will offset that.

[–] [email protected] 3 points 3 months ago (1 children)

Something like an old laptop will make a power-saving homeserver. But that won't work if you want to attach lots of storage.

I don't think an Optiplex is the most energy-efficient choice. They seem somewhat okay, but you'd need to put some effort in and read some tests and reviews to find a really efficient mainboard and PSU. That's not easy

You can spin down your harddisks. I have some udev rule that executes hdparm -S60 /dev/sdb after boot. That'll spin down the hdd after 5 minutes of inactivity. It's alright for low usage scenarios. And it doesn't spin up that often because the hdd contains my photos, backups and a few movies. And my operating system and files that are accessed often, are on a SSD. Starting and stopping disks like once a day should work for many years. But don't cycle it every few minutes.

And obviously, you can also shut off your server over night or just wake it on demand, if that fits your use-case.

[–] [email protected] 2 points 3 months ago (1 children)

Right now I'm turning it over night but during the day I find that I might use it one day a few times and another day not at all. Wake up on demand would be great, I'm worried about the wear from doing it like 3-4 times a day

[–] [email protected] 1 points 3 months ago

I'm not sure if 3-4 times a day is a lot. I had computers (especially laptops) which were way more aggressive with spinning up and down the disks. Maybe you can look it up. A decent (enterprise(?)) hdd should have some datasheet available including info about how often you can powercycle or spin them up/down.

And I wouldn't wake up disks deliberately. If you don't mind the 5-10s waiting, you can just spin them down at the end of the day and leave them that way. The next day they'll either spin up on first access, or they won't. And save that one cycle. I'm not sure though if you can change the spindown timeout during the day without also waking it up. I mean you could run a script that spins them down at 22:00 and sets the timeout to 1h, and at 07:30 you run a script to keep them awake for a 6h period. But you'd need to test if changing that setting wakes them up. Or I'd rather not run a script like that. Sometimes executing hdparm spins up a disk, even if unnecessary.

[–] [email protected] 1 points 3 months ago* (last edited 3 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
PSU Power Supply Unit
PiHole Network-wide ad-blocker (DNS sinkhole)
RAID Redundant Array of Independent Disks for mass storage
SSD Solid State Drive mass storage

4 acronyms in this thread; the most compressed thread commented on today has 10 acronyms.

[Thread #869 for this sub, first seen 14th Jul 2024, 19:25] [FAQ] [Full list] [Contact] [Source code]

[–] [email protected] 6 points 3 months ago* (last edited 3 months ago) (1 children)

If you only use it so rarely, why not just connect a USB drive to your network router? Most have an option to serve files from that over the network.

[–] [email protected] 1 points 3 months ago

That's a great idea that I haven't thought about, but I'm using couple of apps to view and the network thing is less convenient albeit attractive solution that I might look into. Thank you

[–] [email protected] 15 points 3 months ago

If you don't need a lot of resources, I would just get something very low power and an SSD big enough for your purposes, and leave it on all the time. Wake on LAN has never worked reliably for me (or at all, really).

Starting up is definitely where spinning drives experience the most failures. They'll run for tens of thousands of hours just fine, but one day if they stop, they might never spin back up.

You should also just measure your current power consumption for a baseline. You didn't say whether you have a 3050 tower, mini, or micro, but it's really the model of CPU that affects power the most.

[–] [email protected] 6 points 3 months ago* (last edited 3 months ago) (1 children)

I have a similar question that I wonder if anyone can help with. So I'm not overly familiar with self hosting but I'd like to get into it more with simple things, I have a raspberry pi connected to a 3d printer for networked controls and I feel like I should be able to make the raspberry pi not be used just for that only. So like I'm thinking maybe I can run simple things along with it. Basically since the printer is noisy I don't want all that to be on all the time but I'd like the raspberry pi to do oter things too. Maybe I should make a separate post for this haha, anyways thanks for listening. Oh forgot to add my question lol So basically I'm wondering if there's a way that power on lan or something may be useful here

[–] [email protected] 7 points 3 months ago (1 children)

A RasberryPi uses so little power when idleing that turning it on and off on demand makes not a whole lot of a difference. It is different though with OP's x86 with spinning rust drives.

[–] [email protected] 2 points 3 months ago

They're wanting the Pi to do more than one thing. I'm assuming they're running Klipper but also want to run a file server or PiHole, for example, on the same Pi.

[–] [email protected] 3 points 3 months ago (1 children)

Hardware specs would be more useful than the model.

As a general rule, install 'tlp', and 'powertop'. TLP will usually make a decent impact with the defaults detected for your specific hardware, but you can go further by tailoring the config for your specific hardware as well. Powertop is normally better for laptop power measurement on battery, but the tunables section will show you good and bad settings that are currently enabled, which you can easily toggle on and off. It's just an easy interface for new users to be able to dig into detailed power tunables without really harming anything.

[–] [email protected] 4 points 3 months ago

Want to add s-tui to the list of useful power monitoring tools, as well. It's not really focused on 'changes' so much as just presenting pretty graphs and power monitoring.

[–] [email protected] 4 points 3 months ago* (last edited 3 months ago) (2 children)

I had an optiplex 3060 micro with 8500t, 24gb ram and 2 ssds idling around 3-5watts.

[–] [email protected] 1 points 3 months ago

That's impressive! I have less everything, how can I know how much it takes while idle? External device?

[–] [email protected] 2 points 3 months ago (1 children)

I'd question that. I have three 3080 and they're consistently about 8W each with one ssd and onboard graphics. I even went so far to splice three barrel jacks to a single 60w power supply that powers all three to avoid the losses of an additional 2 power supplies and this gets me the 8w idle power with Debian and throttling.

[–] [email protected] 2 points 3 months ago (1 children)

Which fom factor do you have? And did you install powertop and tlp? The newer Intel CPUs need a little more power in idle. Old comment as reference: https://www.reddit.com/r/homelab/comments/m4oif7/comment/gqvs35l/

[–] [email protected] 1 points 3 months ago

I have the micro form factor I assume the same as you. Basically just a laptop in a small desktop case. I never installed tlp I'll have to give that a shot but I'm pretty sure it's optimized. I have two as servers and one as a router and I'd love to get it down to 12w total! I monitor the whole server rack with an iotawatt and all my servers and networking gear hovers around 75w idle.

[–] [email protected] 14 points 3 months ago (1 children)

Wake-on-LAN is probably what you want, if your specific hardware supports it which it probably does. This is a case of figuring out your exact hardware and a little RTFM-ing about how to enable and use WOL.

As for the drives it, in theory, would add more load/unload cycles to them and thus reduce their lifespan. But, in the real world, that almost certainly doesn't matter, unless you're turning the system on and off every 5 minutes: modern drives expect to go in and out of power saving modes and most controllers (especially usb enclosures!) do this pretty aggressively, so a couple more load cycles more-or-less are unlikely to actually cause your drive to fail any quicker than it would anyways.

[–] [email protected] 1 points 3 months ago* (last edited 3 months ago) (1 children)

Thank you

I think it has wake on Lan, so that means any connection attempt would wake it?

[–] [email protected] 1 points 3 months ago

Not quite. Wake on LAN requires a special packet be sent, the OS to boot, then you can attempt to connect to whatever's running.

It's fairly manual (though you COULD maybe automate it, if you have other infrastructure that's watching for things: ex. using home assistant to send the packet when you come home), and has a delay since the system has to boot before it'll respond to anything.

[–] [email protected] 3 points 3 months ago* (last edited 3 months ago) (1 children)

Wake On LAN maybe?

But that requires a full startup sequence before the file is available.

[–] [email protected] 1 points 3 months ago

I don't mind the wait, I'm however worried about the wear from doing that a few times a day

[–] [email protected] 3 points 3 months ago* (last edited 3 months ago)

Wake on lan is fairly well tested, you can have a system that's asleep, sees the packet and turns on.

You just have to wait until the computer completely boots before you can access your resource.

For good demonstration, moonlight and Sunshine do this very well. But you can implement it with many different programs

For SSDs, and NVMEs, turning on and off isn't a big deal. For spinning discs, you would want to minimize the cycles, because that is the most mechanically taxing task they will do. You have to balance the power of keeping the disc spinning all the time, versus the cost of replacing the disc more frequently