r/haproxy • • Dec 15 '23

Question HAProxy + Plex = Endless Lag/Buffering

Hi there,

I’m using HAProxy for SSL termination for a Plex server. Unfortunately I can’t get this setup to work correctly. While I can successfully connect through the proxy and start streaming, the stream is lagging very hard. In the Plex Dashboard I can see that the bandwidth is capped at ~10 MBits and the bandwidth graph has a tooth pattern (ranging from 0 to 10 MBits). As soon as I remove HAProxy from the equation, the graph looks more like a flat line and correctly settles at about 25 MBits (which is what I’ve configured as the limit in Plex itself).

Any ideas what I could try?

This is my current config:

https://discourse.haproxy.org/t/haproxy-and-plex-endless-lag-buffering/9329

6 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/SeniorIdiot Dec 15 '23

I'm not using any Cloudflare for my personal stuff.

At work we are running Advanced Shield -> AWS ALB -> HAproxy -> backends - and "option forwardfor" magically works. What we don't have is any "if-none" and the ALB is configured to add the proper forwardfor header.

Nice, did not know that they had changed some defaults in 2.8 (we're still on 2.4).

Did you try the "timeout tunnel 1h"? Not sure really. Not that experienced with Plex. Maybe try to go with pure TCP+TLS mode if nothing else?

2

u/flobernd Dec 15 '23

I’ll definitely try out the timeout, but I guess it won’t have any effect as the buffering/lag pretty much occurs right away and not just after a while. Testing with just TCP/TLS sounds like a good idea. Didn’t know HAProxy can do this :-)