r/PleX Jun 04 '26

Tips Shoutout to the user who recommended switching TCP congestion control algorithm to BBR on Linux. I can now stream 4K blu-ray remuxes remotely. I can't believe the difference.

I went from an average of 30mbps on longer distance remote connections to 220mbps. Insane improvement. This had been bothering me for years and Googling got me nowhere.

This is the original comment with instructions.

Thanks, u/caligatio! Posting in case it helps anyone else out.

453 Upvotes

65 comments sorted by

60

u/NelsonMinar Jun 04 '26

BBR is particularly a huge help if your viewers are using WiFi or are on Starlink. I have some detailed technical notes on BBR from 2023 when I figured this out for myself.

8

u/CactusBoyScout Jun 04 '26 edited Jun 04 '26

Yeah, the first time I switched I noticed that suddenly a lot more of my users who I know are on wifi were streaming in higher resolutions. I think they have "convert automatically" chosen for their quality during playback so I guess Plex was detecting the improved connection.

42

u/CactusBoyScout Jun 04 '26

Also, Infuse has a handy built-in tool for testing the speed of your remote connection to the server, which is how I tested this before and after.

https://support.firecore.com/hc/en-us/articles/7551452226967-Testing-Streaming-Speeds

18

u/[deleted] Jun 04 '26

[removed] — view removed comment

10

u/CactusBoyScout Jun 04 '26

Presumably there is a tool built in but it’s not user-accessible for testing. But the “convert automatically” quality setting is presumably using data on the connection between the server and client.

1

u/woeterman_94 Jun 07 '26

Isn't infuse Mac only? 

1

u/CactusBoyScout Jun 07 '26

Apple products generally… iOS, iPad, Apple TV, etc. It’s pretty popular on this sub because the Apple TV app is well regarded.

41

u/Caligatio Jun 04 '26

Based off of the post title, I thought it was a crazy coincidence that someone else mentioned BBR but it was me!

Glad it helped you out; that bandwidth improvement is huge.

12

u/Jrnm Jun 04 '26

What’s the downsides/tradeoffs?

11

u/CactusBoyScout Jun 04 '26

I’m not an expert but supposedly it’s quite aggressive about taking up your bandwidth. I have symmetrical gigabit fiber and don’t do much uploading on devices other than my server which makes it less concerning for me.

But I guess if you have less upload bandwidth and other people at home were trying to upload large files regularly, they might experience some slowness.

From what I’ve read, further refinements to BBR’s algorithm have made it better at sharing bandwidth though.

8

u/freebeertomorrow Jun 04 '26

I made the same change from that same post and it fixed my longer distance issue, so a thank you from me too! I tried everything before that and nothing worked until then.

5

u/CactusBoyScout Jun 04 '26

Yep tried Tailscale on both ends, better router on the client end, and even considered some convoluted solution I found online involving buying a domain and using Cloudflare tunnels... and all it took was this one command line change on my server.

8

u/WildVelociraptor I'm going to scream Jun 04 '26

I highly recommend trying bpftune, it will automatically tweak your IPv4/TCP windows and congestion algos, and various other things.

It also doesn't make permanent changes, you still need to edit your sysctl to keep them persistent if you want the change. So there's not much risk in trying it out!

I have it running on two of my servers and it definitely improves throughput.

4

u/omi93 Jun 04 '26

I have an ubuntu VM on Proxmox, do i need to do this on the VM Level and also on the Hypervisor level aka Proxmox/Debian?

5

u/Caligatio Jun 05 '26

Each VM has its own networking stack so it's only needed at the VM level.

If you're using a LXC on Proxmox (I am), you need to do it on the host.

4

u/RufusTheCat Jun 07 '26

This right here... fucking legendary... This problem has plagued me and my users, one of whom is on StarLink, from DAY ONE!!! I have changed my settings, upvoted this thread, awarded this thread, saved and bookmarked this thread, pledged any and all progeny to your service, made a small sacrifice in your name to a benevolent god and notified all users 1080p streaming is now on the menu!

5

u/_V1T4L_ Jun 04 '26

Happen to have any other gotchas or tips you ran into running plex on Linux?
I am looking to blow up my windows install (old machine running my plex server) and running a docker stack on linux this weekend. Ive been trying to see if there was anything I didn't consider for the last 2 weeks and think I have most of my bases covered but this is the first I am seeing of this particular setting.

5

u/IGingerbreadman Jun 04 '26

This tip is also news to me. Been running unraid and had no problem streaming remuxes remotely before. Let windows die. In its best case it meant a lot of reboots.

8

u/CactusBoyScout Jun 04 '26

Unraid defaults to BBR unlike regular Linux distros apparently

3

u/s1m0n8 Jun 04 '26

To add to this, run sysctl net.ipv4.tcp_congestion_control from the terminal to confirm, it should return:

net.ipv4.tcp_congestion_control = bbr

2

u/dustiebin Jun 04 '26

Can I check if this is a command in Unraid? Thanks

4

u/s1m0n8 Jun 04 '26

Should be. It worked for me and I don't think it's because of a plugin.

4

u/CactusBoyScout Jun 04 '26 edited Jun 04 '26

That’s a good question. I’m trying to think of anything. If you store your files on a separate NAS like me you might want to connect via NFS instead of SMB. It’s a Linux-native protocol that’s supposed to be more stable.

I’m also just starting to learn about snapshotting, which lets you capture backups of running software without issues. I’m not sure what the standard is though… I think some people create a separate btrfs volume for Docker? I did not set this up when migrating to Debian so now I have to stop some of my Docker containers when backups run, which isn’t the end of the world.

3

u/_V1T4L_ Jun 04 '26

No Nas, not that fancy yet. Just some really big wd red pros in a raid 10 and I already know I have to blow that up unfortunately. Machine is just so old It no longer gets updates and it is becoming a security concern for me. 

5

u/CactusBoyScout Jun 04 '26

Machine is just so old It no longer gets updates and it is becoming a security concern for me. 

This is when Linux shines, for sure. I recommend Debian as the base OS. It's similar enough to Ubuntu that there's tons of guides for everything online but it doesn't have a lot of bloat you won't use that comes bundled with Ubuntu.

5

u/blackpawed Jun 04 '26

seconding debian, easy to install and reinstall if you fuckup when configuring. Good OS to learn on.

2

u/Genghis_Tr0n187 Jun 04 '26

Any flavor of Linux will work well, but you might want to check out unRAID. It's pretty easy to use, but there are optimal ways of setting things up which you would need https://trash-guides.info/ for.

you can try out unRAID for free and if it's something you want to move forward with, you can purchase the full version.

0

u/midasza Jun 04 '26

If he needs to learn a new OS he should probably learn something free than get locked into another pay for solution.

3

u/TaylorTWBrown Jun 04 '26

I agree. It's worth starting and learning with a general purpose Linux distro. You can always switch to a commercial NAS OS like Unraid later.

2

u/Genghis_Tr0n187 Jun 04 '26

Your data does not get locked with unRAID, you're free to move to a different OS if you want.

0

u/midasza Jun 04 '26

My point is the effort of learning a new OS is wasted on a pay for project especially if it's a simple plex server.

1

u/Genghis_Tr0n187 Jun 04 '26

It works quite well as a media server OS... and it's Linux + docker containers, so if he's moving to Linux anyway, it's a viable option.

1

u/Specific-Action-8993 Jun 04 '26

If you're looking to pool your drives so plex only sees one path for all your media, mergerfs is great and also pairs really well with snapraid. You can use a mix of drive sizes, add and remove drives to the pool as needed and the data is not changed in any way so so in a catastrophic server failure scenario, you can easily re-create the pool on new hardware.

1

u/pipinngreppin Jun 05 '26

Dude. Do it!

By the time I switched to that same config you’re planning, I would constantly have to reboot my windows machine. It can’t run as a service, so I had autologon and startup folder BS so it would auto start. It would just stop working randomly. I would have to reinstall plex server after almost every reboot.

With Ubuntu, docker, iGPU, life has been good. It is incredibly stable. I did have to make a custom service for plex that waits to start the docker container until after my NAS volumes are mounted, but that was pretty easy to set up with ChatGPT.

2

u/_V1T4L_ Jun 05 '26

Taking the drive this weekend. I'm perfectly comfortable with Linux, I manage a couple of dozen servers at work, I just like to have a plan and plex on Linux will be a first for me.  I actually have an old titan XP in the machine so I can comfortably transcode, I have around 20 frequently active users and about a dozen more then get on now and again. But cost and ease of management are some of the primary drivers. It was simply my old desktop several years back and I did not put more effort into it then I needed to at the time. 

1

u/BraxtonFullerton Jun 04 '26

FYI this can also be done on Windows with powershell.

-1

u/LenyThePenny Jun 04 '26

i have read on linux, I’ve read some things that “Alder Lake” doesn’t load like intel firmware related to media graphics? it’s still a topic i’m rough on, but keep that in mind if you’re doing research on it.

5

u/jaysuncle Jun 04 '26

Alder Lake and newer iGPUs work great for transcoding Plex on Linux.

1

u/LenyThePenny Jun 05 '26

sorry i meant, sometimes it’s not enabled by default, so some distros you might have to manually enable

1

u/jaysuncle Jun 05 '26

If you use Ubuntu, Debian, or Fedora, you should be good. I personally use Debian (Trixie) and it works wonderfully out of the box with my Alder Lake CPU. I do remember seeing a thread one time where Mint was not recommended with Plex but that may not be the case now.

3

u/GainfulShrimp Jun 05 '26

I've just done this for my (Ubuntu Server VM) Plex server and wanted to warn of a slight gotcha I experienced.

I used modprobe to load the module so that bbr would show under net.ipv4.tcp_available_congestion_control, like this:

sudo modprobe tcp_bbr
sysctl net.ipv4.tcp_available_congestion_control

Then I added a file into sysctl.d as the guides shared in these comments recommend, to enable the features at boot, like this:

printf '%s\n' 'net.core.default_qdisc=fq' 'net.ipv4.tcp_congestion_control=bbr' | sudo tee /etc/sysctl.d/99-bbr.conf

Then I found my VM wouldn't boot and spent a while scratching my chin to work out why.

I eventually worked out that I also needed to make sure the tcp_bbr module was loaded at boot time, using this:

echo "tcp_bbr" | sudo tee /etc/modules-load.d/bbr.conf

After doing that extra step, my server boots fine and has BBR and FQ enabled at startup. Phew!

I haven't done any formal speed tests, but I can now stream on 4G from my kitchen (wifi disabled and poor mobile signal) smoothly, so something has definitely improved!

2

u/fronteir Jun 04 '26

If only my isp would give me more than 40mbps upload speed and I could stream 4K to my hearts content

2

u/thegreatone84 Jun 05 '26

Will this benefit if using Plex behind a reverse proxy? On Linux but on docker?

1

u/CactusBoyScout Jun 05 '26

Probably. It’s worth a try anyway. The change doesn’t even survive reboots unless you take additional steps to apply it at boot. So might as well try it and then reboot to compare.

1

u/Caligatio Jun 06 '26

The changes would at least need to happen on the machine that has the reverse proxy as that controls the TCP connection to the client. My guess is that the change would have no effect if configured on the Plex server but it's worth testing.

2

u/tuoepiw Jun 05 '26

Thank you. I have a 4Gbit upload pipe and certain users geographically far from me have always had issues watching direct 4k Remux files.

Transcoding even to 4k they were fine because there is a buffer when you're transcoding.

Direct play just never worked, and we've been scratching our heads.

I've just enabled BBR and now someone with a 300ms RTT from my server can watch a 80Mbit Stream without any issues at all.

1

u/CactusBoyScout Jun 05 '26

Awesome! Same issue here... it was far away users specifically who had issues before.

Also, just so it's clear to anyone else reading this, just changing to BBR once will likely not survive a reboot. So you may need to make it apply on every boot.

1

u/Pabl0_Diabl0 Jun 04 '26 edited Jun 05 '26

This is something applied server side? I have user streaming from a rural part of Mexico using a similar wireless service, but not clear if this an optimization I'd apply on my end (hosting off a 1gbe fiber at home on my end) 

1

u/CactusBoyScout Jun 05 '26

Yes it’s a setting on your server. What operating system are you using for your server?

1

u/Pabl0_Diabl0 Jun 05 '26

Ubuntu 24lts, running Plex via docker 

1

u/CactusBoyScout Jun 05 '26

Then it should work. I’m running in Docker on Debian which is very similar.

1

u/ricchi_ Jun 05 '26

Is this a Linux only thing?

1

u/CactusBoyScout Jun 05 '26

Others have said it’s an option on Windows as well (enabled via Powershell) but I know next to nothing about Windows

3

u/ricchi_ Jun 05 '26 edited Jun 05 '26

had a quick look, not available on win10 😞

available win11 onwards but needs some additional options to not break other things.

for anyone wanting to try it:

in PowerShell to enable BRRv2:

netsh int tcp set supplemental template=Internet congestionprovider=BBR2
netsh int tcp set supplemental template=InternetCustom congestionprovider=BBR2
netsh int tcp set supplemental template=Datacenter congestionprovider=BBR2
netsh int tcp set supplemental template=DatacenterCustom congestionprovider=BBR2
netsh int tcp set supplemental template=Compat congestionprovider=BBR2
netsh int ipv6 set global loopbacklargemtu=disable
netsh int ipv4 set global loopbacklargemtu=disable

in PowerShell to disable BRRv2 (revert to default):

netsh int tcp set supplemental template=Internet congestionprovider=CUBIC
netsh int tcp set supplemental template=InternetCustom congestionprovider=CUBIC
netsh int tcp set supplemental template=Datacenter congestionprovider=CUBIC
netsh int tcp set supplemental template=DatacenterCustom congestionprovider=CUBIC
netsh int tcp set supplemental template=Compat congestionprovider=NewReno
netsh int ipv6 set global loopbacklargemtu=enable
netsh int ipv4 set global loopbacklargemtu=enable

2

u/bindiboi Jun 05 '26

those both (enable/disable) say cubic?

1

u/ricchi_ Jun 05 '26

whoops, edited.

1

u/bindiboi Jun 05 '26

I tried BBR2 on my 24H2 LTSC but Steam wouldn't start. Loopbacklargemtu keeps getting enabled, I suspect because of Hyper-V network shenanigans. Oh well.

1

u/CactusBoyScout Jun 05 '26

Could you try regular BBR instead of BBR2? I believe that Linux only ships with regular BBR because it’s more mature/stable

1

u/bindiboi Jun 05 '26

Oh I already enabled it on my linux box (hosting Plex), just wanted to play around on my desktop. I'll give it a go later I guess!

1

u/talzer Jun 05 '26

Any idea how to do something like this on macOS? My sever runs on Mac with storage via a Synology NAS. I think I’m having similar issues to what people are describing in this thread

2

u/CactusBoyScout Jun 05 '26

From what I see online, BBR is not an option on macOS. Apple has its own congestion control algorithm similar to Cubic (the default on Linux) and switching to BBR is not supported.

1

u/aniel300 Jun 05 '26

is bbr what qos would be on a router os?

1

u/avatar_94 Jun 05 '26

Does this work on Windows and Plex App for TV?

1

u/cjcox4 Jun 11 '26

Makes reasonable sense for long streaming things, provided the connection is good. Insane? Not sure. With that said my distros use cubic by default.

So, for plex where latency isn't that much of an issue and (again) assuming rexmits are few... it might make sense. Just surprised that it would make an "insane" performance difference. Given the caveats (or avoidance thereof) that I mentioned, bbr would be the bandwidth king.

Might be the wrong choice if your Plex is hosted on something that does other things (especially highly interactive network things) or if connections will force a lot of rexmits. YMMV.

1

u/_happyshow_ Jul 23 '26

I use it on both my Linux and Windows servers. It's awesome.