[asterisk-bugs] [Asterisk 0012772]: Trunk version of chan_sip significantly slower than 1.4.19.1

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jul 25 13:57:42 CDT 2008


The following issue has been CLOSED 
====================================================================== 
http://bugs.digium.com/view.php?id=12772 
====================================================================== 
Reported By:                ctooley
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   12772
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 suspended
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-06-02 10:09 CDT
Last Modified:              2008-07-25 13:57 CDT
====================================================================== 
Summary:                    Trunk version of chan_sip significantly slower than
1.4.19.1
Description: 
The version of chan_sip in trunk seems to perform actions quite a bit
slower than 1.4.19.1, I have provided some information to Murf.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0012771 [patch] Bogus <member> is still '...
====================================================================== 

---------------------------------------------------------------------- 
 (0090707) murf (administrator) - 2008-07-25 13:57
 http://bugs.digium.com/view.php?id=12772#c90707 
---------------------------------------------------------------------- 
I've done sufficient performance testing that I'm satisfied that the
changes merged to trunk and 1.6.0 (and 1.4) for bug 12771 today, have
removed the main slowdown between 1.4 and trunk. 

I am still not fully satisfied with the performance of chan_sip in trunk,
but it is indeterminate how many man hours/days/weeks/months/years it will
take to find and remove the bottlenecks. Let it suffice to say that,
because of chan_sip's conversion to using astobj2 to index users, peers,
and dialogs, it *should* run a lot faster than 1.4. But it's just on parity
now.

The slowdown: setting the AST_DEVICE_UNKNOWN during sipp testing would
trigger the device_state code to run the ast_parse_device_state() routine,
which would in turn call the ast_get_channel_by_name_prefix_locked()
routine, which is a front end for find_channel_locked. This is a real bad
time to call this function, as the channel is locked, and it eats up huge
amounts of CPU time trying to get the lock over and over again. THis little
storm of activity at precisely these moments had a huge impact on
chan_sip's performance. It slowed everything down, including the ability to
spawn a new thread!
None of this ended up showing up in the profiling data, as the storms of
activity were apparently fairly short, and didn't affect the overall cpu
usage percentages much. I noticed on comparison with 1.4 activity, that the
find_channel_locked routine was getting called like 7000 times in trunk,
and only 3 times in 1.4; the first test reverted the change made in
v.98954; which gave a significant speedup to trunk. It was judged that the
12771 changes should solve the problem in a better way, but perf testing
showed it's a few percent less speedy than the gethostid code.

I suspect that further performance fixes to trunk for chan_sip will yield
good speedups, but that is the subject of another bug report. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-07-25 13:57 murf           Note Added: 0090707                          
2008-07-25 13:57 murf           Status                   acknowledged => closed
======================================================================




More information about the asterisk-bugs mailing list