Could Someone Give Me Advice on Optimising DietPi for a Low-Powered Home Server Setup

Hello everyone :smiling_face_with_three_hearts:

I hope everyone is fine. I am new to Diet Pi; but I am very impressed with its lightweight and adaptable design. I am currently working on a project to build up a low power home server and would appreciate some advice on how to optimise my setup for maximum performance while consuming the least amount of power.

My home server is built on a Raspberry Pi 4 with 4GB of RAM.

  • Using jellyfin to stream media to various devices across the house.
  • A modest nas that uses samba to store family photos; documents; and backups.
  • Runs a modest personal blog and may host a few static webpages.
  • Home automation involves experimenting with home assistant to control smart home gadgets.

My goal is to design an efficient system that can run continuously without considerably increasing my electricity bill. I selected Diet Pi because of its reputation for being lightweight and resource efficient; but I am still learning how to completely optimise it for my requirements.

Current setup includes a Raspberry Pi 4 with 4GB RAM, a 128GB microSD card for DietPi OS; and a 2TB USB 3.0 external hard drive for storage.
USB Ethernet Adapter for Wired Network Connection
DietPi v8.x (the latest stable version)
Jellyfin Samba Nginx with PHP for web server Home Assistant (Docker)

  • What are the best ways to reduce the electrical load on the raspberry pi 4 while running Diet Pi? I have heard about underclocking and changing the CPU governor; but I’m not sure which settings are appropriate for my use case.
  • Given that I am using an external USB drive; what are some pointers for improving file storage and decreasing micro SD card wear? Should I be concerned about data integrity with the existing configuration; and are there any recommended backup strategies?
  • I want to make sure that the services operating on my server are as efficient as feasible. Are there any Diet Pi changes and adjustments that could help decrease the load; while using Jellyfin and home assistant simultaneously?
  • I want to ensure that the services that run on my server are as efficient as possible. Are there any Diet Pi modifications that can reduce the load when using Jellyfin and home assistant simultaneously?
  • Are there any further tools or changes you would recommend for a job like this? I am open to recommendations; particularly there anything I may have overlooked.

Also I explored some topics related to this https://dietpi.com/forum/t/nextcloud-install-hanging-on-g-thread-wait-0-curl-ssfl-https-download-nextcloud-com-server-releases-latest-tar-bzdevops but I did not get the sufficient solution of my query so I would really want to get some help from a more experienced person

I am interested in the potential of this setup and eager to learn from the community’s experience. Any tips or experiences with similar projects would be highly appreciated.

Thanks in advance for your efforts :hugs: :slightly_smiling_face:

To be honest, there is not much room for optimization. A RPI 4 draws only about 4 watts (max 6 watts in synthetic benchmarks, every core on 100%). Undervolting is possibly leading to instabilities.
I would also use the internal NIC and not an USB adapter, bc this will introduce extra power draw.

I would also recommend to boot not from SD card, at some point in the future it will fail. Just boot from the exterrnal drive and make backups regularly.

1 Like

Your Pi barely draws any power, as mentioned by the comment above, a max draw of 6W is beyond negligible in the world of homelabs! Depending on the number of users/concurrent streams you’ll do, a performance governor would be appropriate.

I think the best thing you can do is optimize your media for direct play (x264, depending on your clients). This will avoid transcoding and other bottle necks that come with it. Also if you are setting up the ARRs ensure they use hardlinks and not i/o copy.

There also is a script somewhere in the forum which allows you to offload the arr’s DB into your RAM, allowing for less r/w operations on the HDD, this could be particularly useful in your case.