Embedded Linux performance issue

Dear all,

Recent days, I encountered some issues, the following is my hardware and software configuration:

  1. arm cortex A53 4 cores;
  2. hardware h264 encoder, BP/MP;
  3. Janusgateway 1.1.1;
  4. libnice 0.1.21
  5. stream plugin
  6. default janus.jcfg

the maximum resolution output from the encoder is 4K@60fps, H264 MP 160Mbps(Maximum).
Now the issue is
[WARN] [3188385398111467] Discarding too old outgoing packet (age=1000087us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000092us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000073us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000073us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000054us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000054us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000033us) [WARN] [3188385398111467] Discarding too old outgoing packet (age=1000018us)

So how to improve the performance?
Pls give me some suggestion, thanks.

That message means that the server is taking more than 1 second to relay something. A packet has been put in a queue and it is waiting to be sent over the network for too long.
Very likely the cause is the high load. The bitstream you are handling is HUGE in terms of data rate (160 Mbps!), in particular for an embedded device.

The first step is observing resources consumption: is you CPU overloaded in terms of usage and UNIX load? Is your NIC capable of handling such throughput? Is your RAM memory full?

Then you could try a couple of optimizations, such as:

  • compiling and updated version of Janus with optimized CFLAGS (-O3 -march=native)
  • using 1 helper thread for the streaming mountpoint (check “threads” when creating a mp)
  • tune “event_loops” in janus.jcfg to the number of available cores (4)
  • tuning the bitstream to a more reasonable rate for your requirements (~50Mbps?), or switch to a more efficient encoding if possibile
  • if the media pipeline is being executed on the same embedded device, check that you have enough resources to handle both. If that is not the case, decouple the processes
  • tuning the kernel network buffers to support high throughput streams