summaryrefslogtreecommitdiff
path: root/main/sched.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-02-23 21:20:33 +0000
committerRussell Bryant <russell@russellbryant.com>2007-02-23 21:20:33 +0000
commit9fb1404279bfbff574774c9b416167ab0c77715c (patch)
treeafc48767aa3da427b8993025365755981775afa8 /main/sched.c
parent78a062ac077f7b03a3ab1d27fd2547f3ac7ac73c (diff)
Merge team/russell/iax2_performance.
There is not a large amount of code here and the changes are not very invasive. However, they should significantly improve performance of chan_iax2 under load. IAX2 media frames only carry the *source* call number. So, when one arrives, the correct session that it is a part of has to be matched on IP address, port number, and call number, instead of just a call number. Had these frames carried the *destination* call number, this would not be an issue, because that would be a unique identifier that would make it easy to immediately identify the correct session. The way that chan_iax2 did this matching was extremely inefficient. It starts at the first available call number and traverses each call number sequentially, locking and unlocking a mutex for each one, to try to match against it. It would do this regardless of whether the call number was in use or not. So, for a call with a local call number of 25000, every single incoming media frame would require a traversal that required 25000 mutex lock and unlock operations. (Note that the max call number is about 32k). I have introduced a hash table of active IAX2 calls to improve this lookup process. The hash is done on the IP address, port number, and call number. So, for the previous example, a few lock/unlock operations may be done versus 25000 for each frame. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/sched.c')
0 files changed, 0 insertions, 0 deletions