Huge thanks to Joshua Colp for mirroring services

astobj2 and chan_sip first results

Share on Twitter Digg this story Click to view a printable version Sun, 06 Jan 2008 20:37:23 -0400

Murf has posted details of a conversion and some test results for SIP in Asterisk:

Hello!

I've been slaving over chan_sip for some time now, and have some preliminary comparisons.

1. I'm comparing the 'stock' trunk version to team/murf/bug11210, where I've:
1. put all peers into an astobj2 hash table
2. put all users into an astobj2 hash table
3. put all dialogs (sip_pvt) into an astobj2 hash table
4. put all peers with an IP into an astobj2 hash table.
5. added a small hashtab to the ast_sched struct,
6. changed the ast_sched schedq linked list to be a doubly-linked list

2. In my first round of performance comparisons, I'm running asterisk compiled with no optimizations, and the -pg option added to profile the code. So, don't expect asterisk to run miraculously fast.

3. Also, the test machine (ala digium) is NOT a powerful machine... with 1 gig of memory and running an old version of Ubuntu. It's a Dell 32-bit PC, 2.8Ghz, P4. So, don't expect asterisk to run miraculously fast.
At least compared to the quad-processor 64-bit monsters that folks like to brag about! Oh, btw, I never noted any swapping throughout my testing.

4. All testing done with 'ulimit -n 8196' done previously. I have to do this, or I bump into the 'too many open files' problem. The threshold is about 195 simultaneous calls.

5. I'm using the latest version of sipp to thrash asterisk. I have two basic test scenarios: Run a LOT of really really really short calls, versus running a lot of LONG calls, and see how many you can run at once before problems set in...

for the short calls:
./sipp -sn uac 192.168.134.252 -s 12 -d 100 -l 256
(don't worry, you'll never get close to 256 sim. calls! [at least, not on MY machine!!!] sipp will start out at 10 calls/sec; keep bumping up the call limit until you start seeing retrans and timeouts. Things'll just plain go nuts. When you hit this, you've gone too far.)

for the long calls:
./sipp -sn uac 192.168.134.252 -s 12 -d 100000 -l 270
(run this several times, and vary that last number to find a limit that will allow you to run stably. If sipp goes nuts and cpu idle drops to 0%, stop the test and try again with a lower number!)

6. On my asterisk machine, the sipp entry in sip.conf looks like this:
[asterisk02]
type=friend
context=sipptest
host=192.168.134.240
user=sipp
canreinvite=no
disallow=all
allow=ulaw

7. and the sipptest context in extensions.conf looks like this:

context sipptest
{
_X. => {
Answer();
Background(demo-instruct);
Background(demo-instruct);
Background(demo-instruct);
Background(demo-instruct);
Hangup();
}
}
(I looked around for the longest playing soundfile I could find. Still, playing it 4 times may not take the full 100 secs. Tough. Close enough.)

8. To add spice to life, after the [asterisk02] entry in sip.conf, I added over 4600 other friend entries.

9. Asterisk is running on 192.168.134.252; sipp runs on 192.168.134.240.
Between them are 2 cheap 8-port switches and a router/switch.
Everything is running at 100mbit, and the kids are probably killing each other using network intensive gaming maneuvers in the same network.

OK, I admit it, I feel like a kid who's just put a turbocharger on his 450 V-8. Let's see what this baby can do on the open road. I have the advantage of not having to worry about what the police/sheriff/FBI will think!

Results:

On trunk:

Short Call test: at 100 calls/sec, I start seeing some retransmits after a while at 120 calls/sec, I see 0% cpu idle and sipp goes nuts.
Long Call test: at 270 simultaneous calls, cpu idle bobbles down to 0% frequently, but asterisk seems to hang on.
at 280, things fall apart pretty swiftly.

On my turbocharged V8 version in team/murf/bug11210:

Short Call test: things fall apart at 450 calls/sec. cpu idle drops to
0% and asterisk falls apart.

Long Call test: at 300 simultaneous calls, cpu hits 0% every now and then, but asterisk remains stable. at 310 simul. calls, we are stable for quite a while, but the cpu idle % times keeps bobbing up and down, and when it hits 0% hard, asterisk starts to trip up.
Conclusions: while I can get 4x performance for short calls, I seems to be dealing with some sort of network limit or something for long calls. Still, using hash tables to cut cpu usage, asterisk seems to be able to squeeze a few more calls in before it gets overloaded (about 10% or so?).

Caveats: There's still a few issues to clear up, namely 'pedantic' dialog lookups need to be addressed, and there's an occasional timing issue between the rtp stuff, and dialog destruction. It happens about as often as asterisk crashes in trunk from a bad peer pointer, btw, both problems occur during module reload/unload... always work to do!)

So, anyone wanna take this puppy out for a drive?

murf

--
Steve Murphy
Software Developer
Digium


You haven't voted yet! Vote:
Current Rating: 5/10 (1 votes)

Comments (Click to post)

Comments
Name:
Subject:
Website:
Message: 

Similar Articles (Based on Title)

Convert ast_channel over to astobj2 - March 20, 2009
Russell Bryant has posted a code review for quite a major change with far reaching implications - this should really make a difference.

Asterisk Voicemail Test Results - November 3, 2008


chan_sip errors in CVS stable - December 23, 2004
Olle has posted some information on a recent bug in the stable version of Asterisk.

A chan_sip weekend for 1.2 and 1.4 trunks plus svn trunk - November 13, 2006
Olle has posted details of what he has been up to over the weekend.

Implement ast_channel_search_locked to expensive per-notify channel walk in chan_sip - November 5, 2008
Sean Bright has posted a code review entry for a rework of expensive channel walks.

First Update From Astricon!!! - September 23, 2004
Okay we have the first news in from Astricon, thanks to Chuji. I've pasted it in as it came in.

Magrathea Telecommunications Ltd. becomes first carrier to join Bicom Systems Service Providers Listings - October 30, 2004
Bicom Systems have sent us a press release detailing their new service provider.

SineApps: First Beta of IAXPeers - December 10, 2004
I've just knocked up a quick Windows app that connects to a simple manager proxy and displays ping times for your IAX Peers.

First Asterisk CVS commit from a plane! - January 13, 2005
Kram (Mark Spencer) has committed the first CVS change to Asterisk from a plane. History has been made!

AstriCon 2005 - Early Bird Registration Open (Free IAXy To First 50) - August 5, 2005
Steven Sokol has posted details on a deal for people who register now for the upcoming Astricon conference.

first beta of ruby-agi is out - September 3, 2005
Mohammad Khan has posted info on the first release of his ruby-agi interface.

First release of the Asteriskguru Operator Panel - September 22, 2005
Zoa has posted details of the initial release of the Asteriskguru Operator Panel.

First Public BETA release of AstBill - September 26, 2005
london3 has posted details of the first release of AstBill.


Original Content (C) 2004-2010 Matt Riddell
Back 5  Feed Add
to
Google Subscribe with Bloglines
Go to today

Icons by: FastIcon.com


Back to life
July 21, 2010 Average Vote: 10
Hey all - I am back online after some pretty big projects which have taken all my time. Will be updating the Asterisk news over the next few days.

Nerd Vittles: Building a Bluetooth Proximity Detection System with Asterisk
December 12, 2005 Average Vote: 10
The Nerd Vittles site has an article on proximity detection using Asterisk and a TomTom GPS

Automated Testing Update
July 30, 2010 Average Vote: 10
Russell Bryant has posted details of a new mailing list for automated testing of Asterisk and some information on the progress that has been made. There is no way to say how important I think this work is. It really makes a huge difference to Asterisk and the ability to use it in an enterprise environment. Really great work.

VoIP-Info: FFasterisk Video file converter
August 25, 2006 Average Vote: 10
The wiki has a link to a new piece of software for converting video to the format required for Asterisk.

Code Review: SRTP support for Asterisk
March 12, 2009 Average Vote: 10
Terry Wilson has moved his SRTP branch onto the Digium review board.

HumBug - Pre BETA Launch Registration
July 27, 2010 Average Vote: 10
Nir Simionovich has posted details of the beta of the new call analytics service.

Interview with BKW_
December 7, 2004 Average Vote: 10
We've finally completed our interview with BKW. Hope you like! :-)

SlashDot: GSM and Asterisk Integration
August 21, 2005 Average Vote: 10
There is a post up on SlashDot which talks about using cellphones with Asterisk.

Interview with Mark Spencer
November 26, 2004 Average Vote: 9.9
We have managed to get an interview with Mark Spencer AKA Markster. Mark Spencer is the creator of Asterisk and by far the most active developer.

Asterisk and Kamailio realtime integration tutorial
May 24, 2010 Average Vote: 9.9
Daniel-Constantin Mierla has posted a link to a tutorial on integrating Asterisk and Kamailio using realtime.

Asterisk IPv6 update
February 1, 2010 Average Vote: 9.8
Olle has posted an update on IPV6 in Asterisk and a link to a blog post of his.

Proposal for T.38 transparent gateway design in Asterisk
April 29, 2010 Average Vote: 9.8
Kevin Fleming has posted a proposed design for a transparent T.38 gateway for Asterisk:

Asterisk Monitoring with iPhone and iPod touch
February 12, 2010 Average Vote: 9.7
For the past couple of weeks I have been working on an app that allows you to monitor and restart Asterisk servers.

Monitoring Asterisk with Munin
January 7, 2010 Average Vote: 9.7
I had a few requests for these munin plugins after some discussion on one of the Asterisk lists and thought people might like them.

New Zealand Asterisk Voices
March 2, 2006 Average Vote: 9.7
Chris Hodgetts has posted details of recordings of Asterisk Sounds with a New Zealand accent.


Automated Testing Update
July 30, 2010
Russell Bryant has posted details of a new mailing list for automated testing of Asterisk and some information on the progress that has been made. There is no way to say how important I think this work is. It really makes a huge difference to Asterisk and the ability to use it in an enterprise environment. Really great work.

Asterisk 1.8.0-beta2 Now Available
July 28, 2010
The Asterisk Development Team has announced the release of Asterisk 1.8.0-beta2.

HumBug - Pre BETA Launch Registration
July 27, 2010
Nir Simionovich has posted details of the beta of the new call analytics service.

Branch Merging Changes
July 26, 2010
Russell Bryant has posted details of some changes to the way developers need to commit code to Asterisk because of the newly released 1.8 branch.

Asterisk 1.8.0-beta1 is Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.8.0-beta1. This release marks the beginning of the testing process for the eventual release of Asterisk 1.8.0.

Asterisk 1.6.2.10 Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.6.2.10.

Asterisk 1.4.34 Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.4.34.

AppleRaisin - AstDB over realtime
July 23, 2010
Olle has posted a note about his awesome AppleRaisin branch which provides the ability to store AstDB in realtime. This would make for a much simpler failover and clustering situation.

QueueMetrics 1.6.1 released
July 22, 2010
Lenz has posted a note to inform us that QueueMetrics version 1.6.1 has been released. This release offers a large number of bug fixes, misc improvements and new developements including hotdesking.

Asterisk 1.8 Branch Creation
July 22, 2010
Russell Bryant has posted a note to inform us of the creation of the 1.8 branch of Asterisk.