Tips to optimize Plex Media Server?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
klmmc
Posts: 12
Joined: Fri Mar 06, 2020 8:46 pm

Tips to optimize Plex Media Server?

Post by klmmc »

Hi everyone!
I've been using diet pi for a couple months now, really enjoying the simplicity and efficiency of this distribution.

My setup is :
- Raspberry PI 4B / 2G RAM
- Official case with heatsinks, no fan
- External 3.0 USB HDD 4To, with a USB Y to add a power source. I moved the userdata onto the HDD.
It's formatted in Ext4
- Micro SD 16Go

I use Dietpi with Samba, Deluge, and mainly Plex Media Server.

I'm having a few issues with Plex. I have a library of both 1080p files for remote viewing and 4K for local viewing (with a Xiaomi Mi Box 3 using Kodi and the plex add on). All in direct play of course, and everything is cabled with ethernet.
It works mostly really fine, but with some heavy 4K files with HD audio, the audio starts stuttering after a while, not much but some micro-stutters every few minutes, enough to drive me crazy.
Weird thing is when i add the samba share in kodi without using the plex add on, the file seems to play ok. So, not sure which part of my setup is the bottleneck here. I could play all the files in kodi without using plex, but i would like to keep my library in one place.

CPU config and benchmark below : (overclocking is set on safe)

Image
Image
HDD Benchmark :
Image

Seems like my SD card could be a problem, the rootFS write is very slow...
I tried using a different SD card, using dietpi-backup to backup / restore my data but then, after restoring my backup file and rebooting the system it doesn't start, not sure why...

So, any tips to how to optimize my setup? Or clues about why i can't restore my backup file?

Thanks !
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Tips to optimize Plex Media Server?

Post by Joulinar »

did you checked CPU/Mem consumption while playing files on Plex?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
klmmc
Posts: 12
Joined: Fri Mar 06, 2020 8:46 pm

Re: Tips to optimize Plex Media Server?

Post by klmmc »

Joulinar wrote: Tue Apr 07, 2020 11:01 am did you checked CPU/Mem consumption while playing files on Plex?
Yes, CPU is usually under 10%, RAM around 30%
User avatar
WarHawk
Posts: 610
Joined: Thu Jul 20, 2017 8:55 am

Re: Tips to optimize Plex Media Server?

Post by WarHawk »

My buddy showed me that if you use /dev/shm as the Transcoder temporary directory it reduces read and writes to the drives, in effect it becomes a RAMDrive for the transcoded data for streaming and RAM is immensely faster than any drive or SD card

However be advised it does use RAM and on SBC that can be somewhat limited

https://forums.serverbuilds.net/t/plex- ... -disks/625
klmmc
Posts: 12
Joined: Fri Mar 06, 2020 8:46 pm

Re: Tips to optimize Plex Media Server?

Post by klmmc »

That's a nice tip, however as i don't use transcoding (everything IS direct play) i'm not sure it will help. I will try it though!
Post Reply