longo92
Posts: 44
Joined: Mon Sep 03, 2018 3:45 pm
Contact: Website Skype

sched: RT throttling activated

Fri Jul 19, 2019 8:36 am

Hi,
I have a raspberry pi 0 that runs two application: the first a video-straming app. (takes video from the rpi camera, encodes in H264 and streams) and the second an audio streaming app (takes audio throug a microphone via usb card device, encodes it using opus and then streams), both through websockets.
Th entire cpu load is about 85%.
After sometimes the entire system freeze and i get from dmesg: sched: RT throttling activated.
What does it mean?

Heater
Posts: 12960
Joined: Tue Jul 17, 2012 3:02 pm

Re: sched: RT throttling activated

Fri Jul 19, 2019 8:53 am

No idea. Despite loading up Pi with work for a long time I have never seen that message.

I take "RT" to mean "Real Time"

I presume any kind of "throttling" happens because something is getting over loaded. Too much work load, too much process scheduling, too many interrupts firing off.

Then of course there is throttling that happens when the processor gets overheated due to the amount of work it is doing.

You should watch the output of the "top" command in a terminal Window whilst running your application. It will show how much CPU load your programs are imposing on the system at least.

Then there is the "vcgencmd" that will show if thermal throttling has happened:

Code: Select all

$ /opt/vc/bin/vcgencmd get_throttled
and report the CPU temperature:

Code: Select all

/opt/vc/bin/vcgencmd measure_temp
By the way, I'd love to see your code that streams video over web sockets.

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: sched: RT throttling activated

Fri Jul 19, 2019 9:12 am

Heater wrote:
Fri Jul 19, 2019 8:53 am
Then there is the "vcgencmd" that will show if thermal throttling has happened:

Code: Select all

$ /opt/vc/bin/vcgencmd get_throttled
It will also show if there have been low voltage problems too. There is a bit saying its currently throttled and another sticky bit saying its throttled in the past (since the last boot).
If it reports anything other than 0x0 you have a problem.

User avatar
jojopi
Posts: 3078
Joined: Tue Oct 11, 2011 8:38 pm

Re: sched: RT throttling activated

Fri Jul 19, 2019 10:03 am

Realtime processes take precedence over all other tasks. However, this is intended to ensure low latency in time-critical tasks, not to allow a process to take over the CPU completely. By default, if realtime processes use more than 0.95s of CPU time in one second the kernel assumes there is a problem.

There may be a bug in one of your applications that is causing it to get stuck in a loop without sleeping. Or, since you say that the CPU load is around 85% anyway, it may just be that the Zero's single core is not quite fast enough to keep up in all circumstances.

Do you know where the CPU time is going? This will be some kind of processing, not just shuffling data. Does it help to change the encoding parameters? Does the system keep up if you run only one application at a time?

Return to “C/C++”