bbb-install icon indicating copy to clipboard operation
bbb-install copied to clipboard

Rasos performance gain

Open rasos opened this issue 5 years ago • 8 comments

performance tweaks tested on Ubuntu 18.04

rasos avatar Aug 20 '20 16:08 rasos

fixes #260

rasos avatar Aug 20 '20 16:08 rasos

This is really interesting -- can you be more specific on the improvements you encountered?

ffdixon avatar Sep 20 '20 13:09 ffdixon

We run a few BBB instances, two of them under quite heavy load.
We've applied a low latency kernel as we always do with video / audio related projects, including some Jitsi videobridges.
For BBB, we never had an issue with freeswitch suddenly disappearing nor audio crackling sound.
We did not perform any load / selenium testing though to check how many hundred users / streams can be served. Bottleneck with NodeJS will remain, though.

rasos avatar Sep 20 '20 19:09 rasos

To confirm, you you applied these changes to 18.04 using BigBlueButton 2.3-dev -- right? Was this on a bare-metal server or virtual server?

ffdixon avatar Sep 20 '20 19:09 ffdixon

We have applied a low latency kernel both on BBB 2.2 on Ubuntu 16.04 and on BBB 2.3-dev on Ubuntu 18.04 (the latter not in production use yet). All our BBB servers run on bare metal.

rasos avatar Sep 21 '20 10:09 rasos

@rasos did you experience the problems which this change is supposed to fix/improve on the same environment and same version of bbb before applying these changes? On paper, the low-latency kerne should make next to no difference for a typical BBB setup.

I'd suggest to do some reproducible testing and collect some data.

basisbit avatar Oct 03 '20 03:10 basisbit

If we do end up making these changes, we should prefer to use the linux-lowlatency-hwe-16.04 kernel package in order to get the newer 4.15 kernel backported from ubuntu 18.04 instead of the 4.4 kernel from ubuntu 16.04.

kepstin avatar Oct 05 '20 22:10 kepstin

A low latency kernel should have no (or even a negative) effect.

  • The default scheduling frequency is 250Hz (4ms per tick), which is increased to 1000Hz (1ms per tick) for the low-latency kernel. Freeswitch processes audio in 20ms chunks and the jitterbuffer compensates delays of up to 120ms. Freeswitch also runs at higher priority, so if there is CPU available, freeswitch should have no issue processing audio in a timely manner. A higher scheduling frequency should have no positive effect here.
  • Kernel preemption allows high priority interrupts to steal CPU from processes in the middle of a tick. This is important for real-time processing with extremely small deadlines. But Freeswitch does not need such realtime guarantees. Throughput is more important than low latency in most scenarios.
  • The "audio crackling" issue is caused by packet loss, but this is usually caused by actual network issues and not by overflowing buffers within the network card or kernel. Increasing scheduling frequency or enabling preemption would not help at all. If your network buffers overflow because freeswitch does not read from them fast enough then you have serious throughput problems. Low latency kernels will make this worse, as they sacrifice throughput for low latency.

So, unless someone actually compares those two kernel types on identical hardware in a realistic load scenario with verifiable results, I would be very careful changing defaults. The low-latency kernel may do more harm than good.

defnull avatar Oct 11 '22 13:10 defnull

This pull request is old and, I believe, most users are deploying BigBlueButton using the default kernels.

ffdixon avatar Dec 24 '22 11:12 ffdixon