You are on page 1of 50

Tipping

the Scales
Measuring
and Scaling
Asterisk

CAN YOU SPEAK MAGIC?

Ben Klang

2

CAN YOU SPEAK MAGIC?

“But…Does it Scale?!”
3

CAN YOU SPEAK MAGIC?

Yes!*
* Probably. This is what we’re gonna talk about

4

CAN YOU SPEAK MAGIC?

AGENDA: TIPPING THE SCALES

•Scaling terminology
•Tools of the Trade
•Testing Methodology
•Results

5

CAN YOU SPEAK MAGIC? Scaling Terminology 6 .

CAN YOU SPEAK MAGIC? Calls Per Second (CPS) Concurrent Calls (CC) 7 .

CAN YOU SPEAK MAGIC? CALLS PER SECOND •Rate at which new calls are started •5CPS = 5 calls started each second •Usually meaningful only where: •Average call duration is very short (dialers) •No media is handled (proxies) •For most people. this is not the bottleneck 8 .

CAN YOU SPEAK MAGIC? CONCURRENT CALLS •Number of calls active at any particular moment in time •This is what most people really care about when scaling Asterisk 9 .

CAN YOU SPEAK MAGIC? HOW CPS AND CC RELATE CPS * Avg. Call Duration = CC (peak) 5 CPS * 30s = 150 CC 10 CPS * 30s = 300 CC 10 CPS * 60s = 600 CC 10 .

CAN YOU SPEAK MAGIC? Tools of the Trade 11 .

CAN YOU SPEAK MAGIC? SIP P •THE Open Source SIP load generating tool •High Performance •Very Flexible •XML-based configuration •Awkward command line options •Very Flexible 12 .

CAN YOU SPEAK MAGIC? The Problem with SIPp 13 .

CAN YOU SPEAK MAGIC? STEP 1: WRITE SIP 14 .

CAN YOU SPEAK MAGIC? STEP 2: RECORD A CALL 15 .

18.3.txt \ -trace_err -error_file errors.xml -l 1000 -m 20000 \ -fd 1 -r 5 -s 1 \ -no_rate_quit -rate_max 35\ -rate_increase 1 -rate_interval 30 \ -trace_stat -stf stats_file.log \ -t u1 10.3.18.108 -mp 20953 -trace_screen \ -screen_file screen_file.txt\ -i 10. CAN YOU SPEAK MAGIC? STEP 3: DECIDE SIP P ARGS sudo /usr/local/sbin/sipp -p 8836 \ -sf scenario.134 16 .

CAN YOU SPEAK MAGIC? STEP 4: TEST 17 .

CAN YOU SPEAK MAGIC? PERMUTATIONS! 18 .

CAN YOU SPEAK MAGIC? The Problem with SIPp: 19 .

CAN YOU SPEAK MAGIC? 20 .

Compile SIPp XML + PCAP audio 3. Run SIPp with correct arguments 21 . CAN YOU SPEAK MAGIC? SippyCup 1. Write test steps in simple syntax 2.

wait_for_answer .sleep 5 .2.200 max_concurrent: 1000 calls_per_second: 5 number_of_calls: 20000 steps: .0.0.2.send_digits '#' .invite .send_digits '4045551234' .15 destination: 192.sleep 3 . CAN YOU SPEAK MAGIC? EXAMPLE: SIPPY CUP source: 192.wait_for_hangup 22 .

CAN YOU SPEAK MAGIC? TIME TO CREATE ONE TEST SIPp: ~1 hour SippyCup: ~1 minute 23 .

CAN YOU SPEAK MAGIC? SIP Treadmill 24 .

CAN YOU SPEAK MAGIC? 25 .

CAN YOU SPEAK MAGIC? 26 .

CAN YOU SPEAK MAGIC? Testing Methodology 27 .

CAN YOU SPEAK MAGIC? BAD QUESTIONS •How many calls can Asterisk handle? •I heard “X” is faster than “Y”? •How much CPU/Memory do I need? •Does it scale?! 28 .

CAN YOU SPEAK MAGIC? GOOD QUESTIONS •What is my average call duration? •Am I touching the media? •What if I enable recording? •Can I optimize out transcoding? •Do I need mixing/conferencing? 29 .

CAN YOU SPEAK MAGIC? How much does each Asterisk feature impact the capacity of a given system? 30 .

CAN YOU SPEAK MAGIC? THE PERFORMANCE QUADUMVIRATE 31 .

CAN YOU SPEAK MAGIC? Results 32 .

CAN YOU SPEAK MAGIC? BASELINE: B2BUA 33 .

CAN YOU SPEAK MAGIC? BASELINE: B2BUA 33 .

CAN YOU SPEAK MAGIC? BASELINE: B2BUA Saturation Point 33 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (NATIVE) 34 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (NATIVE) 34 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (NATIVE) 34 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (TRANSCODED) 35 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (TRANSCODED) 35 .

CAN YOU SPEAK MAGIC? FILE PLAYBACK (TRANSCODED) 35 .

CAN YOU SPEAK MAGIC? CONFERENCES (~10 CALLS/ROOM) 36 .

CAN YOU SPEAK MAGIC? CONFERENCES (~10 CALLS/ROOM) 36 .

CAN YOU SPEAK MAGIC? CONFERENCES (~10 CALLS/ROOM) 36 .

CAN YOU SPEAK MAGIC? RECORDED CALL 37 .

CAN YOU SPEAK MAGIC? RECORDED CALL 37 .

CAN YOU SPEAK MAGIC? RECORDED CALL 37 .

CAN YOU SPEAK MAGIC? THE RESULTS 100% 75% 71% 66% 49% se l i n e at i ve ) c ode ) C on f rded Ba ac k ( n ac k ( x S p l i t Reco Playb Playb 38 .

CAN YOU SPEAK MAGIC? IF YOU HEAR NOTHING ELSE… •Test for yourself! •Open Source tools make this not as hard as it used to be •Sippy Cup •SIP Treadmill •SIPp 39 .

io/sippy_cup @MojoLingo github.net @bklang bklang@mojolingo. CAN YOU SPEAK MAGIC? sipp.sf.com/att-innovate/SIPTreadmill 40 .com mojolingo.github.