Top Banner
Tipping the Scales Measuring and Scaling Asterisk
50

Tipping the Scales: Measuring and Scaling Asterisk

Nov 29, 2014

Download

Technology

Mojo Lingo

In this presentation delivered at AstriCon 2014, we look at answering the question: "Does Asterisk scale?!" The answer is nuanced. The presentation includes terminology and tools, as well as some notes on methodology. In the final few slides, we look at several ways Asterisk is employed (B2BUA, transcoding, conferencing, recording) and the impact each feature has on scaling Asterisk. Using the tools and methodologies presented here, I encourage everyone to test their own voice applications and answer the question for themselves: Does It Scale?!
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tipping the Scales: Measuring and Scaling Asterisk

Tipping the Scales

Measuring and Scaling Asterisk

Page 2: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

2

Ben Klang

Page 3: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

3

“But…Does it Scale?!”

Page 4: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

4

Yes!*

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

Page 5: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

AGENDA: TIPPING THE SCALES

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

5

Page 6: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

6

Scaling Terminology

Page 7: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

7

Calls Per Second (CPS)

Concurrent Calls (CC)

Page 8: Tipping the Scales: Measuring and Scaling Asterisk

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

Page 9: Tipping the Scales: Measuring and Scaling Asterisk

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

Page 10: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

HOW CPS AND CC RELATECPS * Avg. Call Duration = CC (peak)

5 CPS * 30s = 150 CC10 CPS * 30s = 300 CC

10 CPS * 60s = 600 CC

10

Page 11: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

11

Tools of the Trade

Page 12: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

SIPP

•THE Open Source SIP load generating tool•High Performance•Very Flexible•XML-based configuration•Awkward command line options•Very Flexible

12

Page 13: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

13

The Problem with SIPp

Page 14: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

STEP 1: WRITE SIP

14

Page 15: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

STEP 2: RECORD A CALL

15

Page 16: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

STEP 3: DECIDE SIPP ARGS

16

sudo /usr/local/sbin/sipp -p 8836 \ -sf scenario.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.txt\ -i 10.3.18.108 -mp 20953 -trace_screen \ -screen_file screen_file.txt \ -trace_err -error_file errors.log \ -t u1 10.3.18.134

Page 17: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

STEP 4: TEST

17

Page 18: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

PERMUTATIONS!

18

Page 19: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

19

The Problem with SIPp:

Page 20: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

20

Page 21: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

SippyCup

1. Write test steps in simple syntax

2. Compile SIPp XML + PCAP audio

3. Run SIPp with correct arguments

21

Page 22: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

EXAMPLE: SIPPY CUP

22

source: 192.0.2.15destination: 192.0.2.200max_concurrent: 1000calls_per_second: 5number_of_calls: 20000steps: - invite - wait_for_answer - sleep 3 - send_digits '4045551234' - sleep 5 - send_digits '#' - wait_for_hangup

Page 23: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

TIME TO CREATE ONE TEST

23

SIPp: ~1 hour

SippyCup: ~1 minute

Page 24: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

24

SIP Treadmill

Page 25: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

25

Page 26: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

26

Page 27: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

27

Testing Methodology

Page 28: Tipping the Scales: Measuring and Scaling Asterisk

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

Page 29: Tipping the Scales: Measuring and Scaling Asterisk

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

Page 30: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

30

How much does each Asterisk feature

impact the capacity of a given system?

Page 31: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

THE PERFORMANCE QUADUMVIRATE

31

Page 32: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

32

Results

Page 33: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

BASELINE: B2BUA

33

Page 34: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

BASELINE: B2BUA

33

Page 35: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

BASELINE: B2BUA

33

Saturation Point

Page 36: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (NATIVE)

34

Page 37: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (NATIVE)

34

Page 38: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (NATIVE)

34

Page 39: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (TRANSCODED)

35

Page 40: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (TRANSCODED)

35

Page 41: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

FILE PLAYBACK (TRANSCODED)

35

Page 42: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

CONFERENCES (~10 CALLS/ROOM)

36

Page 43: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

CONFERENCES (~10 CALLS/ROOM)

36

Page 44: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

CONFERENCES (~10 CALLS/ROOM)

36

Page 45: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

RECORDED CALL

37

Page 46: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

RECORDED CALL

37

Page 47: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

RECORDED CALL

37

Page 48: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

THE RESULTS

38

BaselinePlayback (native)

Playback (xcode)Split Conf

Recorded

49%

66%71%75%

100%

Page 49: Tipping the Scales: Measuring and Scaling Asterisk

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

Page 50: Tipping the Scales: Measuring and Scaling Asterisk

CAN YOU SPEAK MAGIC?

40

@MojoLingo

@bklang [email protected]

sipp.sf.net

mojolingo.github.io/sippy_cup

github.com/att-innovate/SIPTreadmill