I have a problem with playing my 4k movies thru jellyfin with tailscale. It works fine on my wifi but thru tailscale It runs for 5 seconds then buffers for 15 seconds. Is there anything I can do to speed up tailscale? I have fast internet so that should not be the problem
11 replies
tomspark wrote:
You nailed it — genuinely nice detective work. Tailscale ships with a tight memory cap, and pushing 4K direct-play through it is exactly the load that chokes on that cap. Your 2 MB/s → 10-14 MB/s numbers prove it. One important thing: editing the compose file directly gets overwritten on the next update. The way that survives updates is a small file at /opt/sparkbox/state/overrides/tailscale.yml: services: tailscale: deploy: resources: limits: memory: 512M Then sudo sparkbox up. That gives it proper headroom without running fully unlimited. And thanks to your data, we're raising the shipped default in an upcoming update — you found a real one here.
tomspark wrote:
Fast download speed won't help here — it's your upload speed that matters, because your server at home is the one sending the video out over the internet. 4K movies can need 40-80 Mbps upload to stream without buffering, and most home connections are much slower on upload even when download is fast. Check your upload speed on the machine where SparkBox is running (search 'fast.com' in a browser there). If it's under 40 Mbps, that's the bottleneck. Easiest fix: in the Jellyfin app, find the streaming quality or max bitrate setting and cap it at 25 Mbps. It'll send a slightly compressed version of the file that travels cleanly at any normal upload speed, and for 4K on a TV screen the difference is hard to spot.
noahlol01 wrote:
I have 1000/1000 so that should not be a problem. It worked fine before when I had jellyfin and tailscale on windows to remote play my movies
tomspark wrote:
That's a really useful clue — same connection, same Tailscale, but it worked on Windows and now it doesn't. That points at how the stream is being served, not the network itself. The most likely difference: when Jellyfin is running in a container, some clients end up getting a transcoded stream instead of the original file, even over a fast connection. Transcoding on the CPU can't always keep up with 4K, which drains the buffer. While something is playing, check Admin → Dashboard → Active Sessions in Jellyfin — it'll show 'Direct Play' or 'Transcoding' next to your session. Let me know which one you see and we'll go from there.
noahlol01 wrote:
It's direct play. If I ttanscode to 10mbps it's fine. So something is making the network really slow
tomspark wrote:
That's a really helpful detail — it streams fine at 10 Mbps but struggles at full 4K speed (which can be 40–80 Mbps). Tailscale sometimes can't connect your two devices directly and bounces traffic through a middle server instead, which works for small things but gets squeezed out at 4K. Open Tailscale on the device you're watching from, tap your SparkBox in the device list, and check the connection info. If it says something like "relayed via [city]" instead of "direct," that's exactly the issue. Let me know what it shows and we'll fix it.
tomspark wrote:
That detail nails it — transcoding to 10 Mbps is smooth but 4K direct play pushes ~50-100 Mbps, and something is capping you there. Good news: its NOT a SparkBox limit — SparkBox runs Tailscale in full kernel-speed mode, so the box isnt the bottleneck. The usual cause of exactly this (fast line, Tailscale slow) is Tailscale falling back to a RELAY instead of a DIRECT connection. Relays are shared and throughput-capped — fine for 10 Mbps, not for 4K. To check: on the box run docker exec sb-tailscale tailscale status Find the line for the device youre streaming FROM (your laptop/TV). If it says "relay" instead of "direct", thats the culprit. Paste what it shows and Ill walk you through getting a direct connection — its usually a NAT/UDP thing and very fixable.
noahlol01 wrote:
it shows android active; direct
tomspark wrote:
Perfect — active; direct means Tailscale IS giving you a direct connection (no slow relay), so we can cross that off. That points at one thing: your home internets UPLOAD speed. 4k direct play needs a sustained 50-100 Mbps, and most home connections upload far less — which is exactly why dropping to 10 Mbps plays perfectly. Quick check: run a speed test on your SparkBox network and look at the UPLOAD number. If its under ~50 Mbps, thats your ceiling for untouched 4k. The practical fix (and why 10 Mbps was smooth): in the Jellyfin app set a max streaming bitrate for when youre away — around 15-20 Mbps looks great and wont buffer. True untouched 4k remotely would need more upload from your ISP; thats the one piece SparkBox cant change.
noahlol01 wrote:
i have found the problem finally. i thinks its to constraint tailscale Resources. i have commented out for jellyfin and tailscale. but i think tailscale was the problem now i get my 10 -14 MiB/s before i could chocke down to the kb. before i could max reach 2 MB/s. i havent found out what the sweetspot is yet. now it runs on unlimted. but it works now
Chris wrote:
That update landed today. Tom shipped v1.6.463, and your thread is cited in the code as the reason it changed: Tailscale now ships with 512M and 2 CPUs, up from 128M and a quarter of one CPU. The CPU half is the part worth knowing about. The override you were given here only lifted the memory, so that 0.25 CPU ceiling was still sitting on you — and Tailscale does its encryption work in userspace, so that ceiling throttles a 4K direct-play stream directly. To pick it up, run: sudo sparkbox upgrade Your override file now just repeats the new default, so you can remove it or leave it — it does no harm either way.