I self hosted the livekit server on cloud Ubuntu instance, I’m building users streaming app on web.
Issue: I noticed video lags on viewer devices, it sometimes pause, and blur. The streaming is not smooth, lots of buffering I observed. I need a suggestion how I can enhance it. My frontend is Nextjs while backend ka FastAPI.
@Jmc_Global, Self-hosted streaming buffering on viewers usually maps to one of these:
- UDP
50000-60000 not open on the cloud instance’s firewall / security group [Deploying LiveKit | LiveKit Documentation]. Blocked UDP forces TURN/TCP relay, which buffers exactly like this.
use_external_ip: true not set in livekit.yaml [same source]. Without it on a cloud VM, LK advertises its private IP and ICE fails.
Dynacast off ( it’s off by default in livekit-client [ client-sdk-js/src/options.ts] ). Without it, the publisher uploads all simulcast layers regardless of what viewers need, saturating uplink and CPU. Pass dynacast: true in RoomOptions. Simulcast itself is already on by default, so no change needed there.
- Instance bandwidth ceiling. LK recommends
10Gbps ethernet for production [first source]; cheap tiers cap out as viewers grow.
Quick check: chrome://webrtc-internals on a viewer. TURN/relay candidates dominating points at #1 or #2. ICE connected but bitrate dropping points at #3 or #4.
Share your livekit.yaml (redacted), instance size, and viewer count when buffering starts.