Taskprocessor.c: The 'stasis/m:rtp:all-' task processor queue reached 500 scheduled tasks again

Dear Community,

I’ve been noticing a specific behavior related to Stasis (Not sure if its a module/engine/system).
I have 4 asterisk boxes with the same 16-cert version that receive 15-20 cps, and have about 500-600 concurrent channels.

Sometimes when the task processor queue for rtp:all reaches 500 scheduled tasks Asterisk doesn’t process new incoming calls, also, the dialplan doesn’t show any verbose log but hep module sends data to Homer SIP Capture system.

Im not sure how to properly debug this behavior but the CPU doesn’t even surpass 15% of consumption.
Also, i’ve seen that Asterisk Docs has a tuning best practices, but since im not quite familiar with taskprocessors/ulimits i don’t get the core idea.

Any advices or ideas will be greatly appreciated
Warm Regards

I think that is the point of the limits; when they are hit, Asterisk tries to reduce the load by refusing traffic.

@david551
Thanks for the reply,
Do you know where can i see the limits and increase them a bit?
I have plenty of Hardware and BW available
Warm Regards

They are embedded in the code for the most part, so changing requires recompiling. You can disable the PJSIP behavior of rejecting new calls in the configuration file[1] or limit it to only if PJSIP is overloaded.

[1] asterisk/configs/samples/pjsip.conf.sample at master · asterisk/asterisk · GitHub

Do these queues have typical queuing theory type behaviour, i.e. queue length goes up very steeply with increasing traffic? Is there a risk of treating the symptom, rather than the fatal disease?

@david551 Depends on the queue. Fairly linear, unless a factor results in slowing down and then can be steeply. And yes - the message is a symptom, not the cause.

Hi there,
Thanks for the advices and information,

I’ve modified [global] parameter:
taskprocessor_overload_trigger
to:
none

Since i’ve got plenty of HW resources still available, im aware that log notices of taskprocessor queue are just the “threshold” being reached:

[2024-05-06 13:02:50.863] WARNING[3721257] taskprocessor.c: The 'stasis/m:rtp:all-00000064' task processor queue reached 500 scheduled tasks again.

Since i haven’t received that many traffic like the day i started this commmunity thread i cannot confirm that asterisk is no longer rejecting calls due taskprocessor max threshold, but if i can confirm it, ill update this thread.

Also, is there a way to modify stasis rtp:all max queue?
I know that by default some limitations are hardcoded, but i could do a proof of concept.

Some time ago i modified default rounding function (500ms) in cdr.c build file.

Any advices or ideas are appreciated
Warm Regards

I don’t know where it would need to be modified, so can’t really answer where or how.