Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Tuning Mobicents Note

Contents
1. Tuning Sip Servlet ............................................................................................................. 2
2. Tuning Media Server ......................................................................................................... 3
3. Tuning network ................................................................................................................. 5
4. Tuning java ....................................................................................................................... 5
5. Load-Test.......................................................................................................................... 6
5.1. Test1: ......................................................................................................................... 6
5.2. Test2 .......................................................................................................................... 7

1. Tuning Sip Servlet


Stanalone.conf
Thay cc tham s cu hnh ca java khi chy. i li cc s nh sau:
root@ubuntu:~/Mobicents/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/bin# cat standalone.conf

if [ "x$JAVA_OPTS" = "x" ]; then


JAVA_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values:
$JAVA_OPTS"
fi

mss-sip-stack.properties:
Thm cc tham s cho SIP-STACK (nhn x l bn tin SIP)
root@ubuntu:~/Mobicents/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/configuration# cat
mss-sip-stack.properties

gov.nist.javax.sip.LOG_MESSAGE_CONTENT=false # b log ni dung bn tin SIP


gov.nist.javax.sip.LOG4J_LOGGER_NAME=gov.nist
gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS=false
gov.nist.javax.sip.CACHE_SERVER_CONNECTIONS=false # gii phng ngay connection khi terminate
gov.nist.javax.sip.CONGESTION_CONTROL_TIMEOUT=4000
gov.nist.javax.sip.TRACE_LEVEL=0
gov.nist.javax.sip.DEBUG_LOG=logs/mss-jsip-debuglog.txt
gov.nist.javax.sip.SERVER_LOG=logs/mss-jsip-messages.xml
javax.sip.STACK_NAME=Mobicents-SIP-Servlets
javax.sip.AUTOMATIC_DIALOG_SUPPORT=off
gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY=true
#gov.nist.javax.sip.THREAD_POOL_SIZE=100

# khng nh ngha khng c gii hn v pool_size

gov.nist.javax.sip.REENTRANT_LISTENER=true
# prevent DOS attacks
gov.nist.javax.sip.MAX_LISTENER_RESPONSE_TIME=120
gov.nist.javax.sip.MAX_MESSAGE_SIZE=10000
# setting up the buffer size to reduce retransmissions and avoid loosing messages
gov.nist.javax.sip.RECEIVE_UDP_BUFFER_SIZE=65536
gov.nist.javax.sip.SEND_UDP_BUFFER_SIZE=65536
gov.nist.javax.sip.AGGRESSIVE_CLEANUP=true
gov.nist.javax.sip.MAX_FORK_TIME_SECONDS=0
# set to true so that the stack do more validation on dialog,
# but won't work on chained applications so false by default
gov.nist.javax.sip.AUTOMATIC_DIALOG_ERROR_HANDLING=false

2. Tuning Media Server


Run.sh
[root@node2 bin]# pwd
/root/Mobicents/media-server/mobicents-media-server-1/mms-server/bin
[root@node2 bin]# vi run.sh

JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS"
#Thm dng ny
JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx2048m -Dsun.rmi.dgc.client.gcInterval=3600000 Dsun.rmi.dgc.server.gcInterval=3600000"

server-beans.xml
[root@node2 deploy]# pwd
/root/Mobicents/media-server/mobicents-media-server-1/mms-server/deploy
[root@node2 deploy]# vi server-beans.xml

S dng SBC (true) gim %CPU nhng li ch x l lung t ln request th 2 (b qua


request ln u)
<property name="useSbc">true</property>

Tng cc gii hn cho phn media ln con s hp l


<property name="defaultPlayers">1000</property>
<property name="defaultRecorders">1000</property>
<property name="defaultDtmfDetectors">1000</property>
<property name="defaultDtmfGenerators">0</property>
<property name="defaultSignalDetectors">1000</property>
<property name="defaultSignalGenerators">0</property>
<property name="defaultLocalConnections">1000</property>
<property name="defaultRemoteConnections">1000</property>

Tng x l cho phn IVR.


<bean name="IVR" class="org.mobicents.media.core.endpoints.VirtualEndpointInstaller">
<property name="namePattern">mobicents/ivr/</property>
<property
name="endpointClass">org.mobicents.media.core.endpoints.impl.IvrEndpoint</property>
<property name="initialSize">1000</property>
</bean>

<bean name="Bridge" class="org.mobicents.media.core.endpoints.VirtualEndpointInstaller">


<property name="namePattern">mobicents/bridge/</property>
<property
name="endpointClass">org.mobicents.media.core.endpoints.impl.BridgeEndpoint</property>
<property name="initialSize">1000</property>
</bean>

3. Tuning network
Resolv.conf
[root@node2 etc]# pwd
/etc
[root@node2 etc]# vi resolv.conf

Tr DNS v default gateway


; generated by /sbin/dhclient-script
nameserver 192.168.1.1 ;default gateway
search localdomain

4. Tuning java
Khuyn ngh dng bn java c h tr Hotspot (khng ci bng yum hoc apt-get)
[root@node2 etc]# java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

5. Load-Test
S dng SIPP

5.1. Test1:
./sipp -sf uac_pcap.xml 192.168.1.206:5080 -r 20 -t tn -recv_timeout 10000

-sf uac_pcap.xml : file cu hnh kch bn cuc gi (gi cuc gi trong 30s)
-r 20 : 20 cuc gi trn mt giy
-t tn: mi cuc gi to mi mt tcp-socket (trnh b nghn retrains)
-recv_timeout 10000 : timeout 10s cho cc response nhn v (nu khng nhn dc response
trong vng 10s th hu connection )
Kt qu:
------------------------------ Scenario Screen -------- [1-9]: Change Screen -Call-rate(length)

Port

Total-time

Total-calls

20.0(0 ms)/1.000s

5061

2334.60 s

46692

Remote-host
192.168.1.37:5080(TCP)

19 new calls during 0.910 s period

0 ms scheduler resolution

1017 calls (limit 1800)

Peak was 1029 calls, after 2329 s

1 Running, 1556 Paused, 38 Woken up


16 dead call msg (discarded)

29 out-of-call msg (discarded)

1020 open sockets

Messages

Retrans

Timeout

46691

100 <----------

180 <----------

46359

200 <----------

E-RTD1 46358

ACK ---------->

46358

INVITE ---------->

Unexpected-Msg

Pause [

29.0s]

46358

Pause [

1000ms]

45858

BYE ---------->

45819

200 <----------

45068

603

------------------------------ Test Terminated --------------------------------

5.2. Test2
./sipp -sf uac_pcap.xml 192.168.1.206:5080 -r 10 -t tn -recv_timeout 10000

Kt qu:
------------------------------ Scenario Screen -------- [1-9]: Change Screen -Call-rate(length)

Port

Total-time

Total-calls

10.0(0 ms)/1.000s

5060

6323.45 s

63234

Remote-host
192.168.1.206:5080(TCP)

35 new calls during 3.502 s period

0 ms scheduler resolution

419 calls (limit 900)

Peak was 430 calls, after 5925 s

118 Running, 446 Paused, 164 Woken up


183 dead call msg (discarded)

0 out-of-call msg (discarded)

422 open sockets

Messages

Retrans

Timeout

63234

100 <----------

538

180 <----------

62665

200 <----------

E-RTD1 62665

ACK ---------->

62665

INVITE ---------->

Unexpected-Msg

Pause [

29.0s]

62665

Pause [

1000ms]

62334

BYE ---------->

62277

200 <----------

62008

184

85

------------------------------ Test Terminated --------------------------------

You might also like