Asterisk Benchmark with SIPP


I’m trying to test one asterisk box by using Sipp application, the scenario is very simple:

/usr/local/bin/sipp -sf asterisk.xml -d 1000 -recv_timeout 10000 -m 50 -l 10

which sends 10 concurrent calls until 50 calls. Dialplan is simple as well, just answering the call and playback a file for 30 seconds then hung up.
Sipp showns a very bad statistic:

Successful call | 0 | 39
Failed call | 0 | 11

which is very strange for this capacity. The server is a VM, with this configuration:

$ nproc

$ free -m
total used free shared buff/cache available
Mem: 7981 512 4076 105 3393 6995
Swap: 4095 0 4095

OS: CentOS 7 X64
load average: 0.00, 0.02, 0.13

In wireshark/sngrep, i observed that packets are coming to Asterisk, but for some INVITES he is not replying back with 100 Trying and Sipp is trying to retransmit the packets until is getting timeouts.


In the Asterisk logs i didn’t found any errors and network statistic also, is not too bad:

$ watch -n1 “ss -4 -n -l | grep 5060”
udp UNCONN 0 0 *:5060 :

$ watch-n1 “ip -s link show”

ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:fd:5f:6b brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    2565530245 12890391 0       0      0       0
    TX: bytes  packets  errors  dropped carrier collsns
    1485871230 4254402  0       0       0       0

asterisk*CLI> core show settings

PBX Core settings
  Version:                     16.2.0
  Build Options:               BUILD_NATIVE, OPTIONAL_API, G711_NEW_ALGORITHM
  Maximum calls:               500 (Current 0)
  Maximum open file handles:   65000
  Root console verbosity:      8
  Current console verbosity:   8
  Debug level:                 0
  Maximum load average:        0.000000
  Minimum free memory:         0 MB
  Startup time:                10:28:37
  Last reload time:            10:28:37
  System:                      Linux/3.10.0-957.1.3.el7.x86_64 built by root on x86_64 2019-02-19 10:17:51 UTC
  System name:                 server1
  Entity ID:                   00:0c:29:fd:5f:61
  PBX UUID:                    cc72507a-07ce-46d4-a1f8-7283604016fa
  Default language:            en
  Language prefix:             Enabled
  User name and group:         asterisk/asterisk
  Executable includes:         Enabled
  Transcode via SLIN:          Enabled
  Transmit silence during rec: Disabled
  Generic PLC:                 Enabled
  Generic PLC on equal codecs: Disabled
  Min DTMF duration::          80
  Cache media frames:          Enabled
  RTP use dynamic payloads:    1
  RTP dynamic payload types:   35-63,96-127

* Subsystems
  Manager (AMI):               Enabled
  Web Manager (AMI/HTTP):      Disabled
  Call data records:           Enabled
  Realtime Architecture (ARA): Enabled

Why the Asterisk cannot process all INVITES? where is the bottleneck?
Thank You.

Your configuration, as presented, does not include any channel driver that would accept SIP requests, let alone one configure to accept them on a non-standard port number.

I’m using pjsip as channel driver:

server1*CLI> pjsip show transports

Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress....................>

Transport:  transport-udp             udp      0      0

Objects found: 1

It’s bound to port 5060. If I read your log correctly, you are sending the invites to port 6000.

Sorry, i didn’t take full screenshot, 6000 it’s a media port - INVITE is coming to 5060 port.

By sending 4 concurrent calls up to 20 - the statistic look a bit better, but not as it should be:

Successful call    |        0          |       18
Failed call        |        0          |        2

Also, Asterisk Box have an External IP Address, it’s not after NAT.

Have you looked at the Asterisk console output at all? Have you looked at the SIPp output to see where in the scenario things are failing?

On the Asterisk console - there is no Errors/Warnings at all.
This is what i’m getting in Sipp:

sipp: The following events occured:
2019-02-19      11:36:22.736144 1550576182.736144: Call-Id: 14-6993@, receive timeout on message Basic Sipstone UAC:10 without label to jump to (ontimeout attribute): aborting call.

You need enough logging to show that Asterisk was receiving the requests and how it responded.

I don’t see any indication that the packets are reaching Asterisk or that any responses were sent at all. Run a trace on the Asterisk server and see if the packets are getting there and if so, if they’re getting blocked by a firewall perhaps.

It might be that asterisk are not receiving those packets at all, with tcpdump/sngrep i can see the packets coming to the server - but i’m not sure that they are reaching the asterisk service, i was thinking that maybe the network queue buffer if full - but it is not… Firewall/Selinux are disabled completely on the server. If the problem can be in network - what else should i check?

Looks that problems is not in the Network Stack - but with Asterisk itself.
By enabling “pjsip set logger on” i was able to see that INVITE’s are coming - but Asterisk is not replying them back.
From 50 concurrent calls - on 16 of them Asterisk replied with “100 Trying” only after 9 seconds!
Could be the problem in the pjsip library?

If the system is under load (queues are backed up) then Asterisk will ignore new requests, to give time to work off the existing load so that the system doesn’t get overloaded. There is a patch up[1] to control this behavior a bit more. It is still being worked on and reviewed, and is only available for 13 currently - it will be put up against the other branches once review is further along.