[Home]

Summary:ASTERISK-28707: Pjsip Threadpool cant handle more than 10 calls per second
Reporter:Ahmet Hancer (ahmeth)Labels:
Date Opened:2020-01-21 00:39:16.000-0600Date Closed:2020-02-04 12:00:01.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:16.2.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux Centos 7Attachments:
Description:Hi,

Using sipp I run loadtests on Asterisk and I observe If I send 10 calls per second Monitor_thread and pjsip Threadpool(with 200 threads) can handles calls with 30second duration long. But say if I send 50 calls per second using sipp to Asterik I observe monitor_thread can handle it without problem but threadpool cant: I see as monitor_thread processed 1000 calls (new INVITE) while threadpool only processed around 300 calls(New INVITE) and rest are ignored

I will appreciate if you can help

Regards
Comments:By: Asterisk Team (asteriskteam) 2020-01-21 00:39:16.690-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2020-01-21 04:37:38.647-0600

Always ensure you are using the latest version of Asterisk for testing. Secondly we provide configuration in pjsip.conf[1] to control the threadpool, its size, etc. Finally there is always going to be a limit and PJSIP by default will start dropping new calls to let things catch up. As well, what are you trying to achieve? If you want to be able to handle a specific amount you're going to need to identify the bottlenecks and see if there is any way to resolve.

[1] https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L1012

By: Joshua C. Colp (jcolp) 2020-01-21 04:39:02.689-0600

I should also add that configuration can play a part. For example - are you using realtime? That will impact and change things. The speed of the system and its performance will also alter things.

By: Ahmet Hancer (ahmeth) 2020-01-21 05:06:50.630-0600

Hi,

Actually I am using Asterisk only for SIP signalling so I expect It will be very fast so that can handle 1000cps, single monitor_thread can deal with 200cps but pjsip threadpool(taskprocessor) cannt handle more than 10cps I wonder why even I observe only 2-3 thread are running at a given time. Number of threads increase but mostly majority of them are idle

Regards


By: Joshua C. Colp (jcolp) 2020-01-21 05:10:12.505-0600

Asterisk isn't a SIP proxy and isn't simply moving around messages, so even without media there is a substantial cost to setting up and handling calls. If you need high capacity SIP routing then a SIP proxy would be a MUCH better fit as that is what they are designed for.

The code will predictably distribute calls to threads, depending on the contents of the SIP request it can cause the calls to end up over a few threads.

If you still want to use Asterisk you'd need to do profiling, understand the bottleneck, see if there are ways to improve it.

By: Ahmet Hancer (ahmeth) 2020-01-21 06:03:01.621-0600

I am using Asterisk as a B2BUA without media on Asterisk. My setup as follows:

{noformat}
sipp        →        Asterisk        →        sipp
from user A       single Dial app      with user B
                    to user B
{noformat}

I run sipp with 50cps user A to user B

single monitor_thread with epoll is fast enough to deal with load but problem in threadpool taskprocessor. It looks threadpool is waiting for something or blocked for some reason

regards

By: Asterisk Team (asteriskteam) 2020-02-04 12:00:01.141-0600

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines