Académique Documents
Professionnel Documents
Culture Documents
environments
Saúl Ibarra Corretgé <saul@irontec.com>
http://www.saghul.net
saghul
http://www.irontec.com
AMOOCON 2009 - Running Asterisk in virtualized environments
About me
● saghul
– VoIP enthusiast, playing around with Asterisk since 2k5
– Started testing virtualization solutions 3 years ago
– GNU/Linux lover :)
● Irontec
– Small company located at the north of Spain
– Web design, VoIP systems, ... everything under GNU/Linux
– Always trying to be at the bleeding edge of technology
2
AMOOCON 2009 - Running Asterisk in virtualized environments
http://www.irontec.com/~saul/amoocon2k9.tar.gz
3
AMOOCON 2009 - Running Asterisk in virtualized environments
Index
1. Introduction to virtualization
2. Virtualization types
3. Test-bench setup
4. Testing
1. Xen
2. KVM
3. No virtualization
5. Results analysis
6. Conclusions
4
Introduction to virtualization
AMOOCON 2009 - Running Asterisk in virtualized environments
Introduction to virtualization
● Virtualization
– The ability to use a single physical computer to run several
“simulated” computers
6
Virtualization types
AMOOCON 2009 - Running Asterisk in virtualized environments
Virtualization types
● Emulation
● Full virtualization
● Paravirtualization
● OS level virtualization
8
AMOOCON 2009 - Running Asterisk in virtualized environments
Emulation
9
AMOOCON 2009 - Running Asterisk in virtualized environments
Full virtualization
● Similar to emulation
● Some instructions are run on the raw hardware (Intel VT or
AMD V is needed)
● Host and guests have to be the same architecture
● Guest OS runs unmodified
● Often used instead of paravirtualization, when guest OS is
distributed in binary form (e.g. Windows)
● Better performance than emulation
10
AMOOCON 2009 - Running Asterisk in virtualized environments
Paravirtualization
11
AMOOCON 2009 - Running Asterisk in virtualized environments
OS level virtualization
12
Test-bench setup
AMOOCON 2009 - Running Asterisk in virtualized environments
Test-bench setup
Testing Equipment
● HP ProLiant ML310
● Dual Intel(R) Xeon(R) CPU 3075 @ 2.66GHz
● RAM: 2GiB DDR2 800MHz
● 2 x 80GB HDD – RAID0
● OS: Debian 5.0 (Lenny) 64-bit
● Cheap 3Com Gigabit switch
14
AMOOCON 2009 - Running Asterisk in virtualized environments
15
AMOOCON 2009 - Running Asterisk in virtualized environments
● Software used:
– Asterisk ;)
– SIPp (stress-testing)
– Tcpdump (sniffing RTP for use with SIPp)
– sar (CPU usage, HD, IO stats)
– sadf (extract sar's data)
● Limits:
– ulimit -s unlimited # stack size
– ulimit -n 65536 # open files
– ulimit -u unlimited # user process num.
16
Testing
AMOOCON 2009 - Running Asterisk in virtualized environments
Testing
Send 2.000 calls with SIPp (100s RTP bidirectional media). 400
simultaneous calls maximum.
18
AMOOCON 2009 - Running Asterisk in virtualized environments
Testing (II)
19
AMOOCON 2009 - Running Asterisk in virtualized environments
Testing: Xen
20
AMOOCON 2009 - Running Asterisk in virtualized environments
Testing: KVM
21
AMOOCON 2009 - Running Asterisk in virtualized environments
Testing: No virtualization
22
AMOOCON 2009 - Running Asterisk in virtualized environments
Call stats
2500
2000
1500
TotalCallCreated
SuccessfulCall(C)
FailedCall(C)
1000
500
0
2009-04-2722:37:30:372 1240864650.372034 2009-04-2722:43:30:383 1240865010.383449
2009-04-2722:34:30:367 1240864470.367186 2009-04-2722:40:30:377 1240864830.377034
23
AMOOCON 2009 - Running Asterisk in virtualized environments
Call stats
2500
2000
1500
TotalCallCreated
SuccessfulCall(C)
FailedCall(C)
1000
500
0
2009-04-2819:47:13:296 1240940833.296806 2009-04-2819:51:13:302 1240941073.302805
2009-04-2819:45:13:293 1240940713.293946 2009-04-2819:49:13:299 1240940953.299805 2009-04-2819:53:13:308 1240941193.308350
24
AMOOCON 2009 - Running Asterisk in virtualized environments
Call stats
2500
2000
1500
TotalCallCreated
SuccessfulCall(C)
FailedCall(C)
1000
500
0
2009-04-2722:59:26:051 1240865966.051527 2009-04-2723:05:26:506 1240866326.506768
2009-04-2722:56:26:043 1240865786.043268 2009-04-2723:02:26:055 1240866146.055127
25
AMOOCON 2009 - Running Asterisk in virtualized environments
1000
800
KVM
600
Xen
No-virt
400
200
0
1 2 3 4 5 6 7 8 9 10
26
AMOOCON 2009 - Running Asterisk in virtualized environments
CPU usage
80
70
60
50
%user
40 %system
%iowait
30
20
10
0
2009-04-27 20:35:57 UTC 2009-04-27 20:38:37 UTC 2009-04-27 20:41:17 UTC 2009-04-27 20:43:57 UTC 2009-04-27 20:46:37 UTC 2009-04-27 20:49:17 UTC
2009-04-27 20:34:37 UTC 2009-04-27 20:37:17 UTC 2009-04-27 20:39:57 UTC 2009-04-27 20:42:37 UTC 2009-04-27 20:45:17 UTC 2009-04-27 20:47:57 UTC
27
AMOOCON 2009 - Running Asterisk in virtualized environments
CPU usage
90
80
70
60
%user
50
%system
40 %iowait
30
20
10
0
2009-04-28 17:46:29 UTC 2009-04-28 17:48:29 UTC 2009-04-28 17:50:29 UTC 2009-04-28 17:52:29 UTC
2009-04-28 17:45:29 UTC 2009-04-28 17:47:29 UTC 2009-04-28 17:49:29 UTC 2009-04-28 17:51:29 UTC 2009-04-28 17:53:29 UTC
28
AMOOCON 2009 - Running Asterisk in virtualized environments
45
40
35
30
%user
25 %system
%iowait
20
15
10
0
2009-04-27 20:57:45 UTC 2009-04-27 20:59:45 UTC 2009-04-27 21:01:45 UTC 2009-04-27 21:03:45 UTC 2009-04-27 21:05:45 UTC 2009-04-27 21:07:45 UTC
2009-04-27 20:56:45 UTC 2009-04-27 20:58:45 UTC 2009-04-27 21:00:45 UTC 2009-04-27 21:02:45 UTC 2009-04-27 21:04:45 UTC 2009-04-27 21:06:45 UTC
29
AMOOCON 2009 - Running Asterisk in virtualized environments
18
16
14
12
%memused
10
%swpused
0
2009-04-27 20:35:57 UTC 2009-04-27 20:38:37 UTC 2009-04-27 20:41:17 UTC 2009-04-27 20:43:57 UTC 2009-04-27 20:46:37 UTC 2009-04-27 20:49:17 UTC
2009-04-27 20:34:37 UTC 2009-04-27 20:37:17 UTC 2009-04-27 20:39:57 UTC 2009-04-27 20:42:37 UTC 2009-04-27 20:45:17 UTC 2009-04-27 20:47:57 UTC
30
AMOOCON 2009 - Running Asterisk in virtualized environments
Memory usage
90
80
70
60
50
%memused
%swpused
40
30
20
10
0
2009-04-28 17:46:19 UTC 2009-04-28 17:47:59 UTC 2009-04-28 17:49:39 UTC 2009-04-28 17:51:19 UTC 2009-04-28 17:52:59 UTC
2009-04-28 17:45:29 UTC 2009-04-28 17:47:09 UTC 2009-04-28 17:48:49 UTC 2009-04-28 17:50:29 UTC 2009-04-28 17:52:09 UTC 2009-04-28 17:53:49 UTC
31
AMOOCON 2009 - Running Asterisk in virtualized environments
Memory usage
8
%memused
4
%swpused
0
2009-04-27 20:57:55 UTC 2009-04-27 21:00:15 UTC 2009-04-27 21:02:35 UTC 2009-04-27 21:04:55 UTC 2009-04-27 21:07:15 UTC
2009-04-27 20:56:45 UTC 2009-04-27 20:59:05 UTC 2009-04-27 21:01:25 UTC 2009-04-27 21:03:45 UTC 2009-04-27 21:06:05 UTC 2009-04-27 21:08:25 UTC
32
AMOOCON 2009 - Running Asterisk in virtualized environments
1600
1400
1200
1000
totsck
800
600
400
200
0
2009-04-27 20:35:47 UTC 2009-04-27 20:38:07 UTC 2009-04-27 20:40:27 UTC 2009-04-27 20:42:47 UTC 2009-04-27 20:45:07 UTC 2009-04-27 20:47:27 UTC
2009-04-27 20:34:37 UTC 2009-04-27 20:36:57 UTC 2009-04-27 20:39:17 UTC 2009-04-27 20:41:37 UTC 2009-04-27 20:43:57 UTC 2009-04-27 20:46:17 UTC 2009-04-27 20:48:37 UTC
33
AMOOCON 2009 - Running Asterisk in virtualized environments
Socket activity
2500
2000
1500
totsck
1000
500
0
2009-04-28 17:46:19 UTC 2009-04-28 17:47:59 UTC 2009-04-28 17:49:39 UTC 2009-04-28 17:51:19 UTC 2009-04-28 17:52:59 UTC
2009-04-28 17:45:29 UTC 2009-04-28 17:47:09 UTC 2009-04-28 17:48:49 UTC 2009-04-28 17:50:29 UTC 2009-04-28 17:52:09 UTC 2009-04-28 17:53:49 UTC
34
AMOOCON 2009 - Running Asterisk in virtualized environments
Socket activity
1800
1600
1400
1200
1000
totsck
800
600
400
200
0
2009-04-27 20:57:45 UTC 2009-04-27 20:59:45 UTC 2009-04-27 21:01:45 UTC 2009-04-27 21:03:45 UTC 2009-04-27 21:05:45 UTC 2009-04-27 21:07:45 UTC
2009-04-27 20:56:45 UTC 2009-04-27 20:58:45 UTC 2009-04-27 21:00:45 UTC 2009-04-27 21:02:45 UTC 2009-04-27 21:04:45 UTC 2009-04-27 21:06:45 UTC
35
AMOOCON 2009 - Running Asterisk in virtualized environments
Tweaking (Xen)
● Xen tweaking:
– DomU in an LVM volume
– 1GB of RAM for the DomU
– Ethernet checksum disabled for the domU adapter:
ethtool -K eth0 tx off
– System limits 'extended'
– Had to 'tweak' dahdi_dummy.c so that it corretly handles
timing source.
36
AMOOCON 2009 - Running Asterisk in virtualized environments
Tweaking (KVM)
● KVM tweaking:
– Guest in an LVM volume
– 1GB of RAM for the guest
– Paratirtualization drivers
● Virtio block device
● Virtio network device
– System limits 'extended'
37
Results analysis
AMOOCON 2009 - Running Asterisk in virtualized environments
Results analysis
39
AMOOCON 2009 - Running Asterisk in virtualized environments
40
Conclusions
AMOOCON 2009 - Running Asterisk in virtualized environments
Conclusions
42
AMOOCON 2009 - Running Asterisk in virtualized environments
Thanks!
43
Any questions?
AMOOCON 2009 - Running Asterisk in virtualized environments
License
http://creativecommons.org/licenses/by-sa/3.0/
45