Solved Slow streaming on FreeBSD 12.2-RELEASE with Intel 10G X550T

Hi!

I'm sorry if this is the wrong place to post this, I'm fairly new to FreeBSD and I've been using Debian for a long time.

I have a streaming server running Plex, on a remote machine, located in a Datacenter, this machine was running Debian and working as intended. But I've been toying with the BSD family for awhile and found that the simplicity and sanity of the OS is miles away from what Debian could offer. So I made a backup of my media library, reinstalled the whole OS with a fresh copy of FreeBSD 12.2-RELEASE with ZFS. I ran "pkg install plexmediaserver", reloaded my library (it was actually way faster than Debian).

Now here's the mind boggling part, when I stream any media, or even try to download it via the browser, my FreeBSD has very bad performance, I'm getting ~200kbps, while on Debian I would get ~50mbps. It's the same bare metal server, the only thing that changed was the OS.

I would love any input on this, maybe I'm missing some crazy tweak? I even went and spinned a VM on Vultr with FreeBSD 12.1, went through the same process, tried one test video, same thing, slow speeds, when using the same VM specs with Debian I could easily max my connection.

Again, sorry if this is the wrong place to ask, I've already went through Plex forums, and #freebsd on freenode but I wasn't able to solve this.

Thanks in advance for any help on this!

PS: I've tried changing the "net.inet.tcp.cc.algorithm" to "htcp" with a little bit of improvement, I would get higher speeds right at the beginning and then it would drop again.
 
I have a Plex server running at home and have no issues with it. No tweaks, just a plain, bog standard, FreeBSD install.

Now here's the mind boggling part, when I stream any media, or even try to download it via the browser, my FreeBSD has very bad performance, I'm getting ~200kbps, while on Debian I would get ~50mbps. It's the same bare metal server, the only thing that changed was the OS.
What network interface does the machine have? Did you enable a firewall? The combination (firewall+interface) may have problems with TSO/LRO, try switching those off.

Code:
     -tso    If the driver supports tcp(4) segmentation offloading, disable
             TSO on the interface.  It will always disable TSO for ip(4) and
             ip6(4).

     -lro    If the driver supports tcp(4) large receive offloading, disable
             LRO on the interface.
From ifconfig(8).
 
Hi!

Thanks for your reply! I've reinstalled the whole OS (I think I've already tried a lot of tweaks), and disabled both TSO/LRO, but there was no difference on the streaming speeds.

I've found an error on my side, fixed it, but didn't change anything too, but I was using OpenBSD syntax on the pf.conf file, I guess at least now the pf.conf is kinda sane :)
https://pastebin.com/FVpmF5Wr

I have 2 NICs in this machine:
Code:
ix0@pci0:4:0:0: class=0x020000 card=0x15631849 chip=0x15638086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller 10G X550T'
    class      = network
    subclass   = ethernet
ix1@pci0:4:0:1: class=0x020000 card=0x15631849 chip=0x15638086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller 10G X550T'
    class      = network
    subclass   = ethernet

I'm only using one NIC, the ix0, the other is for internal traffic.

Other than that this case is really strange, the machine is practically idle while using Plex, but the network performance is very low. I have a 1Gbps uplink on this machine, and as I said on the first post I could easily get 30MB/s download speeds from home, now I get 200KB/s.

I've run the following test, I've entered Plex then clicked on a random file and chose "Download File" via the browser, I was having ~200KB/s speeds. Then I've connected via SFTP and went to download that same file, and got around the same speeds. But on the other hand, I had 5 ~ 6 MB/s speed while doing the same procedure using Debian.

All of this just sounds strange, I understand that they are apples and oranges, the OSs are different, but that huge of a difference in networking speeds in just something I can't explain unfortunately.

As always, thanks for all your help and patience!
 
Those if_ix(4) interfaces may need a couple of tweaks. Not sure what though, if I recall correctly a few other forum members have those cards, they might be able to provide better information. I've adjusted the thread title to make it more visible.
 
Hi! Thanks for the help and the change on the thread title!

I've just made another test, which makes me think this is not Plex related even more. I've created bogus 1Gb files using "dd if=/dev/zero of=1g.img bs=1 count=0 seek=1G", on a FreeBSD VM on DigitalOcean, on the remote machine on the original post, on a fresh Debian VM on DigitalOcean, and on a Debian bare metal remote server that I have. Then I've connected via SFTP and tried to download those 4 files, I've got the same results, on the FreeBSD one's I got ~200KB/s max speed, and on the Debian ones I got 5MB/s.

I'm even more confused, maybe it's because I'm using ZFS? I really don't have any more ideas about this. Sorry to keep bothering you, and as always thanks for all your patience!
 
I think I've found it, I used my mobile phone to connect to the remote FreeBSD Plex install via a 4G connection, then I proceeded to stream a file at max resolution, and it just worked. Is it possible that the problem is on my router? That it somehow treats a Linux connection differently than a FreeBSD one?
 
Yup, that's it, It was kinda hard to find, but with the help from some awesome folks at #FreeBSD on freenode they pointed out that since my ISP is using PPPoE I should use the "mpd5" implementation, now I'm getting full speeds and Plex is streaming normally!

Thanks for all the help and patience!
 
Back
Top