Review Board 1.7.16


Stasis performance improvements

Review Request #2873 - Created Sept. 20, 2013 and submitted

David Lee
/team/dlee/performance
Reviewers
asterisk-dev
Asterisk
This patch addresses several performance problems that were found in
the initial performance testing of Asterisk 12.

The Stasis dispatch object was allocated as an AO2 object, even though
it has a very confined lifecycle. This was replaced with a straight
ast_malloc().

The Stasis message router was spending an inordinate amount of time
searching hash tables. In this case, most of our routers had 6 or
fewer routes in them to begin with. This was replaced with an array
that's searched linearly for the route.

We more heavily rely on AO2 objects in Asterisk 12, and the memset()
in ao2_ref() actually became noticeable on the profile. This was
#ifdef'ed to only run when AO2_DEBUG was enabled.

After being misled by an erroneous comment in taskprocessor.c during
profiling, the wrong comment was removed.
Unit tests pass.

Using the setup below, sipp was run against the 12 branch both with
and without my changes.

==
[test-server]$ cat extensions.conf 

[performance]
exten => service,1,Answer
exten => service,n,Wait(1)
exten => service,n,Hangup

[test-server]$ cat sip.conf 

[perf](!)
type=peer
qualify=no
disallow=all
allow=g722
allow=ulaw
insecure=invite,port
context=performance

[test-client](perf)
host=test-client

Simple sipp scenario:
[test-client]$ sipp -sn uac -l 100 -r 50 tests-server
Total:
12
Open:
0
Resolved:
10
Dropped:
2
Status:
From:
Review request changed
Updated (Sept. 30, 2013, 2:22 p.m.)
  • changed from pending to submitted
Committed in revision 400193

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.