Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Added a note on UDP buffer size in srt-live-transmit #1239

Merged
Merged
43 changes: 43 additions & 0 deletions docs/srt-live-transmit.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,46 @@ uses the opposite connection mode. Typically you use the **SRT listener** on the
since it is easier to configure in terms of firewall/router setup. It also makes sense to leave the
Sender in listener mode when trying to connect from various end points with possibly
unknown IP addresses.

## UDP Performance

Performance issues concerning reading from UDP medium were reported
in [#933](https://github.com/Haivision/srt/issues/933) and
[#762](https://github.com/Haivision/srt/issues/762).

The dedicated research showed that at high and bursty data rates (~60 Mbps)
the `epoll_wait(udp_socket)` is not fast enough to signal about the possibility
to read from a socket. It results in losing data when the input bitrate is very high (above 20 Mbps).

Waiting on a UDP socket with `::select(...)` works perfect,
but it can't be used in the current implementation of the `srt-live-transmit`.

PR [#1152](https://github.com/Haivision/srt/pull/1152) (v1.5.0 and above) adds a possibility
to set the buffer size of the UDP socket in `srt-live-transmit`.
Having a bigger buffer of UDP socket to store incomming data, `srt-live-transmit` handles high bitrates.

The following steps have to be performed to use the bigger UDP buffer size.

### Increase the system-default max rcv buffer size

```
$ cat /proc/sys/net/core/rmem_max
212992
$ sudo sysctl -w net.core.rmem_max=26214400
net.core.rmem_max = 26214400
$ cat /proc/sys/net/core/rmem_max
26214400
```

### Specify the size of the UDP socket buffer via the URI

Example URI:
```
"udp://:4200?rcvbuf=67108864"
```

Example full URI:
```
./srt-live-transmit "udp://:4200?rcvbuf=67108864" srt://192.168.0.10:4200 -v
```