SlideShare a Scribd company logo
 
Tuning and development with SIP Servlet on Mobicents Naoki Nishihara OKI Electric Industry Co.,Ltd Jean Deruelle Mobicents Sip Servlets Lead
Agenda Introduction SIP Application behavior How to tune the JavaVM for SIP Servlet How to develop SIP Servlet Application with Frameworks
Introduction Mobicents fellow Member of mobicents core team from March 2011 Leading mobicents SSF project For developing SIP Servlet Application with Spring Framework OKI has been involved SIP Servlet development since 2003
About OKI Founded January 1881 Major Operation Manufacturing and sales of products, technologies, software and solutions for telecommunications systems and information systems
Current works Support Japanese carrier (They are evaluating the OSS platform) Customize MSS for proprietary  ex) NOT include internal IP Address in SIP header fields Developing customized SIP Load balancer
SIP Servlet Behavior
SIP Servlet Behavior (1) To establish one session, some messages are sent and received.
Basic B2BUA sequence UAC UAS MSS INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 200/INVITE ACK ACK BYE BYE Established Session 200/BYE 200/BYE 2 dialogs 6 transactions 12 messages
SIP Servlet Behavior (2) Many object will be generated in one sequence.
Created instances After 10,000 calls  (NOT TERMINATED SESSION) NameValueList NameValue HostPort Host DuplicateNameValueList MultiValueMapImpl SipURI Authority AddressImpl gov.nist.core. gov.nist.javax.sip. :810,041 :330,015 :310,036 :310,036 :290,049 :290,049 :240,006 :240,006 :210,003 Instance counts
Mobicents SIP Servlet  own behavior JAIN-SIP, SIP Servlet, JBoss(J2EE)… About 200 Threads run on MSS (for transport, timer, cluster…)
Other problems related to SIP Retransmissions will occur, if response was sent late over 500ms with UDP transport In normal case, UDP transport will be used. If JVM was stopped long time by GC Call failure will be occurred and error handling may not work properly. SIP has many timers, they could not work properly. It’s relatively easy to retry with HTTP, but you would have to start over from scratch to initiate session with SIP
Conclusion MSS will discard many objects in one session. When retransmissions of UDP messages occurred, Many threads runs at the same time Many objects are discarded CPU usage go up GC will be missed Full GC will run Fall in a vicious cycle
How To Tune the Java VM
Plan Reduce retransmissions of UDP Response time less than 200ms Measure the performance on tuned JVM 400call/sec(1440,000BHCA) Effective use of multiple CPU Most of server-machine have multiple CPU Reduce pause times by “Stop-The-World”
Test Sequence UAC UAS Mobicnets INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 200/INVITE ACK ACK BYE BYE Established Session 200/BYE 200/BYE 10sec 30sec About 16,000 sessions will remain on JVM
Recommended Sun Java VM Options -server -XX:+UseTLAB is enabled. -XX:+UseConcMarkSweepGC CMS GC reduce the “Stop the World”. -XX:+CMSIncrementalMode Enable the incremental mode. You should tune the below options -XX:CMSIncrementalDutyCycle=<N> -XX:CMSIncrementalDutyCycleMin=<N>
Other performance options(1) -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 Object that related to SipSessions will NOT be collected in NewGC. This option will make the full NewSize available to every NewGC cycle. -XX:+UseParNewGC Enable a parallel young generation GC. (for multiple cpu machine) -XX:CMSInitiatingOccupancyFraction=75 Set the level at which the collection is started -XX:+CMSParallelRemarkEnabled Reduce remark pause with multi threads
Other performance options (2) -XX:+UseStringCache Enables caching of commonly allocated strings -XX:+OptimizeStringConcat Optimize String concatenation operations where possible -XX:+UseCompressedStrings Use a byte[] for Strings which can be represented as pure ascii -XX:+UseCompressedOops Enables the use of compressed pointers for optimized 64-bit performance
Data and results Default GC CMS GC without tuning the duty cycle CMS GC with tuning the duty cycle Add parallel NewGC and performance options Analyze: GC, CPU usage, failed call, succeeded call, Retransmissions, Average response time,…
GC options (1) -Xms6g -Xmx6g -XX:PermSize=256m -XX:MaxPermSize=256m
Default GC Over thousands failed calls And retransmissions “ Stop The World” about 8 seconds Thousands responses took more than 200ms
GC options (2) -Xms6g -Xmx6g -XX:PermSize=256m -XX:MaxPermSize=256m -XX:UseConcMarkSweepGC -XX:+CMSIncrementalMode
CMS GC  without tuning the duty cycle 0 failed call GC pause time less than 100ms CPU usage increased Decreased time-consuming response
GC options (3) -XX:UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=100 -XX:CMSIncrementalDutyCycleMin=100
CMS GC with tuning the duty cycle CPU usage decreased Retransmissions decreased GC pause time less than 100ms Decreased time-consuming response
GC options (4) -XX:-CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=100 -XX:CMSIncrementalDutyCycleMin=100 -XX:+UseStringCache -XX:+OptimizeStringConcat -XX:+UseCompressedStrings -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseCompressedOops -XX:CMSInitiatingOccupancyFraction=75 -XX:+CMSParallelRemarkEnabled
Add parallel NewGC and performance options CPU usage decreased Memory usage decreased Retransmissions increased Increased time-consuming response
Results Recommended VM options are useful. Reduce pause times No failed calls Reduce retransmissions Tuning options of the duty cycle are very useful Other performance options are slightly useful
Developing SIP Servlet with frameworks
SIP Servlet Frameworks Mobicents has 2 SIP Servlet Frameworks SSF (Spring Signaling Framework) Based on Spring Framework CTF(CDI-Telco-Framework) CDI Based framework These frameworks have same concept… Simplify SipServlets development We want to merge these framework’s functions and support many developers!
Spring Signaling Framework SSF
How to develop SIP Servlet application with SSF
Why using Spring Framework? Standard DI Container Familiar to many Java Developers  Customizable Context SSF provide customized Context for SIP Servlet Many functionality modules are working on Spring Framework. You can create the converged application with Spring Framework modules.
Create SIP Servlet with POJO @Component public   class  ProxyHandler { @Autowired ProxyBean proxyBean; @Autowired CheckRequireBean checkRequire; @SipServletRequestMapping(methods = { &quot;INVITE&quot;, &quot;UPDATE&quot;, &quot;MESSAGE&quot;, &quot;PUBLISH&quot; }) public   void  handleRequest(SipServletRequest req)  throws  Exception { // start checkRequire.handleRequest(req); if  (req.isCommitted()) { return ; } proxyBean.startProxy(req); // end } … . Component Scan Autowired Original annotation Call bean’s method
Easy to add functions Of course, you can use AOP function Try to add the Call-Blocking function to the proxy service.  
Add Call-Blocking function (1) Create new POJO for Call-Blocking @Component public   class  CallBlockingBean { public   void  handleRequest(SipServletRequest req)  throws  IOException { if (isBlocked(req)) { SipServletResponse res = req.createResponse(SipServletResponse. SC_SERVICE_UNAVAILABLE ); res.send(); return ; } } … .
Add Call-Blocking function(2) Create Aspect class for Advice @Aspect public   class  ProxyAround { @Autowired CallBlockingBean callBlocking; @Around(“execution(ProxyHandler.handleRequest(..)) && args(req)”) public   void  handleRequest(ProceedingJointPoint pjp, SipServletRequest req)  throws  IOException { callBlocking.handleRequest(req); pjp.proceed(new Object[]{req}); } … .
Add Call-Blocking function (3) Add configurations for AOP <aop:aspectj-autoproxy proxy-target-class= &quot;true&quot; /> <context:component-scan base-package= &quot;org.mobicents.ssf.examples.sip.beans&quot; > <context:include-filter type= &quot;aspectj&quot;  expression= &quot;org..ProxyAround*&quot;  /> </context:component-scan> <context:component-scan base-package= &quot;org.mobicents.ssf.examples.sip.sipserver“/ > Just Do It!  
CDI-Telco-Framework CTF
CDI JSR-299 CDI is the Java standard for dependency injection and contextual lifecycle management, led by  Gavin King  for  Red Hat , Inc. and is a  Java Community Process (JCP) specification that integrates cleanly with the Java EE platform. Any Java EE 6-compliant application server provides support for JSR-299 (even the web profile). Loose coupling with strong typing Well-defined lifecycle for stateful objects bound to lifecycle contexts Support for Java EE modularity and the Java EE component architecture
CDI-Telco-Framework  Mobicents brings the power and productivity benefits of CDI into the Mobicents Sip Servlets platform providing dependency injection and contextual lifecycle management for converged HTTP/SIP applications.
CDI-Telco-Framework  Mission Statement simplify SipServlets development by introducing a clean programming model ease of development by making available SIP utilities out of the box providing dependency injection and contextual lifecycle management to the SipServlets.
CDI-Telco-Framework  public class SipRegistarClient { .... @Inject SipFactory sipFactory; protected void doRegister(@Observes @Register SipServletRequest req) throws ServletException, IOException {          .... register user here ... }
Contact Naoki Nishihara [email_address] Jean Deruelle [email_address] Georges [email_address] Vladimir Ralev [email_address]
Gratitude
Appendix
Configuration mss-1.6.0-snapshot-jboss-jdk6-5.1.0GA-1103310643 With Simple B2BUA application SIPp as UAC & UAS Jdk1.6.0_24 RHEL5 2.6.18-164.el5
Target server machine HP PROLIANT DL360 G6(504634-291) Intel(R) Xeon(R) CPU  E5540  @ 2.53GHz stepping 05 4 core Memory: 32G
Default GC
Long Load
Over Load
Ad

More Related Content

What's hot (20)

FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
建澄 吳
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation SlidesAsterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
David Duffett dCAP
 
Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible Netflow
Cisco DevNet
 
BEST REST in OpenStack
BEST REST in OpenStackBEST REST in OpenStack
BEST REST in OpenStack
Vikram G Hosakote
 
Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!
Cisco DevNet
 
ClueCon 2017
ClueCon 2017ClueCon 2017
ClueCon 2017
Luca Pradovera
 
SIP Testing with FreeSWITCH
SIP Testing with FreeSWITCHSIP Testing with FreeSWITCH
SIP Testing with FreeSWITCH
Moises Silva
 
Device Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play SolutionDevice Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play Solution
Cisco DevNet
 
Layer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Layer-3 BFD Optimization Proposals for Enterprise and Campus NetworksLayer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Layer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Vikram G Hosakote
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
deimos
 
IoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & SparkIoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & Spark
Red Hat Developers
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
Cisco DevNet
 
Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
deimos
 
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video APIDevelop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
Enablex io
 
OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANG
Tail-f Systems
 
Using PerfDHCP tool to scale DHCP in OpenStack Neutron
Using PerfDHCP tool to scale DHCP in OpenStack NeutronUsing PerfDHCP tool to scale DHCP in OpenStack Neutron
Using PerfDHCP tool to scale DHCP in OpenStack Neutron
Vikram G Hosakote
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to Libfabric
Jeff Squyres
 
OPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV: A Multi-Vendor, Interoperable, NFV SolutionOPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV
 
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Brent Salisbury
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
建澄 吳
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation SlidesAsterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
Asterisk and WebRTC - Digium 'Demo & Eggs' Presentation Slides
David Duffett dCAP
 
Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible Netflow
Cisco DevNet
 
Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!
Cisco DevNet
 
SIP Testing with FreeSWITCH
SIP Testing with FreeSWITCHSIP Testing with FreeSWITCH
SIP Testing with FreeSWITCH
Moises Silva
 
Device Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play SolutionDevice Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play Solution
Cisco DevNet
 
Layer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Layer-3 BFD Optimization Proposals for Enterprise and Campus NetworksLayer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Layer-3 BFD Optimization Proposals for Enterprise and Campus Networks
Vikram G Hosakote
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
deimos
 
IoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & SparkIoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & Spark
Red Hat Developers
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
Cisco DevNet
 
Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
deimos
 
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video APIDevelop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
Enablex io
 
OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANG
Tail-f Systems
 
Using PerfDHCP tool to scale DHCP in OpenStack Neutron
Using PerfDHCP tool to scale DHCP in OpenStack NeutronUsing PerfDHCP tool to scale DHCP in OpenStack Neutron
Using PerfDHCP tool to scale DHCP in OpenStack Neutron
Vikram G Hosakote
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to Libfabric
Jeff Squyres
 
OPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV: A Multi-Vendor, Interoperable, NFV SolutionOPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV: A Multi-Vendor, Interoperable, NFV Solution
OPNFV
 
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Brent Salisbury
 

Viewers also liked (6)

Mobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
Mobicents Summit 2012 - Twilio Expanding internationally Challenges SolutionsMobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
Mobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
telestax
 
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestCommMobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
telestax
 
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
Jean Deruelle
 
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
telestax
 
Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/O
Arawn Park
 
Java EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanJava EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 Mean
Alex Theedom
 
Mobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
Mobicents Summit 2012 - Twilio Expanding internationally Challenges SolutionsMobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
Mobicents Summit 2012 - Twilio Expanding internationally Challenges Solutions
telestax
 
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestCommMobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
telestax
 
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
New Opportunities for Real Time Communications - WebRTC Conference Japan - Fe...
Jean Deruelle
 
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
Mobicents Summit 2012 - Yulian Oifa - Implementing Mobicents based IMS archit...
telestax
 
Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/O
Arawn Park
 
Java EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanJava EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 Mean
Alex Theedom
 
Ad

Similar to Tuning and development with SIP Servlets on Mobicents (20)

Tunning mobicent-jean deruelle
Tunning mobicent-jean deruelleTunning mobicent-jean deruelle
Tunning mobicent-jean deruelle
Ivelin Ivanov
 
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP ServletsMobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
telestax
 
From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011
telestax
 
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Jarek Wilkiewicz
 
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Jean Deruelle
 
Session Initiation Protocol - In depth analysis
Session Initiation Protocol - In depth analysisSession Initiation Protocol - In depth analysis
Session Initiation Protocol - In depth analysis
chinmaypadhye1985
 
SIP servers on embedded systems: Powering SoHo communications
SIP servers on embedded systems: Powering SoHo communicationsSIP servers on embedded systems: Powering SoHo communications
SIP servers on embedded systems: Powering SoHo communications
RADVISION Ltd.
 
Download It
Download ItDownload It
Download It
Videoguy
 
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
telestax
 
FutureComm 2010: Scaling Advanced VoIP Telecom Services
FutureComm 2010: Scaling Advanced VoIP Telecom ServicesFutureComm 2010: Scaling Advanced VoIP Telecom Services
FutureComm 2010: Scaling Advanced VoIP Telecom Services
RADVISION Ltd.
 
VoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP CommunicatorVoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP Communicator
chinmaypadhye1985
 
Mobicents SIP Servlets Failover
Mobicents SIP Servlets FailoverMobicents SIP Servlets Failover
Mobicents SIP Servlets Failover
Jean Deruelle
 
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
telestax
 
Sip and the java platforms
Sip and the java platformsSip and the java platforms
Sip and the java platforms
Anupam Khandelwal
 
Genesys SIP Server Architecture
Genesys SIP Server ArchitectureGenesys SIP Server Architecture
Genesys SIP Server Architecture
Ranjit Patel
 
Uit Presentation of IN/NGIN for Cosmote 2010
Uit Presentation of IN/NGIN for  Cosmote  2010Uit Presentation of IN/NGIN for  Cosmote  2010
Uit Presentation of IN/NGIN for Cosmote 2010
michael_mountrakis
 
FutureComm 2010: SIP Server Applications on Embedded Platforms
FutureComm 2010: SIP Server Applications on Embedded PlatformsFutureComm 2010: SIP Server Applications on Embedded Platforms
FutureComm 2010: SIP Server Applications on Embedded Platforms
RADVISION Ltd.
 
Indigo Product And Technology Overivew 2005
Indigo Product And Technology Overivew 2005 Indigo Product And Technology Overivew 2005
Indigo Product And Technology Overivew 2005
ir. Carmelo Zaccone
 
Scall
ScallScall
Scall
Mayank Bhushan
 
The Role of a SIP Softswitch in the Enterprise
The Role of a SIP Softswitch in the EnterpriseThe Role of a SIP Softswitch in the Enterprise
The Role of a SIP Softswitch in the Enterprise
Alok Vasudeva
 
Tunning mobicent-jean deruelle
Tunning mobicent-jean deruelleTunning mobicent-jean deruelle
Tunning mobicent-jean deruelle
Ivelin Ivanov
 
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP ServletsMobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
Mobicents Summit 2012 - Jean Deruelle - Mobicents SIP Servlets
telestax
 
From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011From MSS to TelScale - Mobicents Summit 2011
From MSS to TelScale - Mobicents Summit 2011
telestax
 
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Developing VoIP Applications with SIP Servlets, SDForum Java SIG, Nov 2007
Jarek Wilkiewicz
 
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Mobicents 2.0, The Java Open Source Communications Platform-FOSDEM 2011 Jean ...
Jean Deruelle
 
Session Initiation Protocol - In depth analysis
Session Initiation Protocol - In depth analysisSession Initiation Protocol - In depth analysis
Session Initiation Protocol - In depth analysis
chinmaypadhye1985
 
SIP servers on embedded systems: Powering SoHo communications
SIP servers on embedded systems: Powering SoHo communicationsSIP servers on embedded systems: Powering SoHo communications
SIP servers on embedded systems: Powering SoHo communications
RADVISION Ltd.
 
Download It
Download ItDownload It
Download It
Videoguy
 
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
Mobicents Summit 2012 - Vladimir Ralev - Mobicents Load Balancer and High Ava...
telestax
 
FutureComm 2010: Scaling Advanced VoIP Telecom Services
FutureComm 2010: Scaling Advanced VoIP Telecom ServicesFutureComm 2010: Scaling Advanced VoIP Telecom Services
FutureComm 2010: Scaling Advanced VoIP Telecom Services
RADVISION Ltd.
 
VoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP CommunicatorVoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP Communicator
chinmaypadhye1985
 
Mobicents SIP Servlets Failover
Mobicents SIP Servlets FailoverMobicents SIP Servlets Failover
Mobicents SIP Servlets Failover
Jean Deruelle
 
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011
telestax
 
Genesys SIP Server Architecture
Genesys SIP Server ArchitectureGenesys SIP Server Architecture
Genesys SIP Server Architecture
Ranjit Patel
 
Uit Presentation of IN/NGIN for Cosmote 2010
Uit Presentation of IN/NGIN for  Cosmote  2010Uit Presentation of IN/NGIN for  Cosmote  2010
Uit Presentation of IN/NGIN for Cosmote 2010
michael_mountrakis
 
FutureComm 2010: SIP Server Applications on Embedded Platforms
FutureComm 2010: SIP Server Applications on Embedded PlatformsFutureComm 2010: SIP Server Applications on Embedded Platforms
FutureComm 2010: SIP Server Applications on Embedded Platforms
RADVISION Ltd.
 
Indigo Product And Technology Overivew 2005
Indigo Product And Technology Overivew 2005 Indigo Product And Technology Overivew 2005
Indigo Product And Technology Overivew 2005
ir. Carmelo Zaccone
 
The Role of a SIP Softswitch in the Enterprise
The Role of a SIP Softswitch in the EnterpriseThe Role of a SIP Softswitch in the Enterprise
The Role of a SIP Softswitch in the Enterprise
Alok Vasudeva
 
Ad

Recently uploaded (20)

論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
DNF 2.0 Implementations Challenges in Nepal
DNF 2.0 Implementations Challenges in NepalDNF 2.0 Implementations Challenges in Nepal
DNF 2.0 Implementations Challenges in Nepal
ICT Frame Magazine Pvt. Ltd.
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
AI and Gender: Decoding the Sociological Impact
AI and Gender: Decoding the Sociological ImpactAI and Gender: Decoding the Sociological Impact
AI and Gender: Decoding the Sociological Impact
SaikatBasu37
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptxIn-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
aptyai
 
Right to liberty and security of a person.pdf
Right to liberty and security of a person.pdfRight to liberty and security of a person.pdf
Right to liberty and security of a person.pdf
danielbraico197
 
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
Building a research repository that works by Clare Cady
Building a research repository that works by Clare CadyBuilding a research repository that works by Clare Cady
Building a research repository that works by Clare Cady
UXPA Boston
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
AI and Gender: Decoding the Sociological Impact
AI and Gender: Decoding the Sociological ImpactAI and Gender: Decoding the Sociological Impact
AI and Gender: Decoding the Sociological Impact
SaikatBasu37
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptxIn-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
aptyai
 
Right to liberty and security of a person.pdf
Right to liberty and security of a person.pdfRight to liberty and security of a person.pdf
Right to liberty and security of a person.pdf
danielbraico197
 

Tuning and development with SIP Servlets on Mobicents

  • 1.  
  • 2. Tuning and development with SIP Servlet on Mobicents Naoki Nishihara OKI Electric Industry Co.,Ltd Jean Deruelle Mobicents Sip Servlets Lead
  • 3. Agenda Introduction SIP Application behavior How to tune the JavaVM for SIP Servlet How to develop SIP Servlet Application with Frameworks
  • 4. Introduction Mobicents fellow Member of mobicents core team from March 2011 Leading mobicents SSF project For developing SIP Servlet Application with Spring Framework OKI has been involved SIP Servlet development since 2003
  • 5. About OKI Founded January 1881 Major Operation Manufacturing and sales of products, technologies, software and solutions for telecommunications systems and information systems
  • 6. Current works Support Japanese carrier (They are evaluating the OSS platform) Customize MSS for proprietary ex) NOT include internal IP Address in SIP header fields Developing customized SIP Load balancer
  • 8. SIP Servlet Behavior (1) To establish one session, some messages are sent and received.
  • 9. Basic B2BUA sequence UAC UAS MSS INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 200/INVITE ACK ACK BYE BYE Established Session 200/BYE 200/BYE 2 dialogs 6 transactions 12 messages
  • 10. SIP Servlet Behavior (2) Many object will be generated in one sequence.
  • 11. Created instances After 10,000 calls (NOT TERMINATED SESSION) NameValueList NameValue HostPort Host DuplicateNameValueList MultiValueMapImpl SipURI Authority AddressImpl gov.nist.core. gov.nist.javax.sip. :810,041 :330,015 :310,036 :310,036 :290,049 :290,049 :240,006 :240,006 :210,003 Instance counts
  • 12. Mobicents SIP Servlet own behavior JAIN-SIP, SIP Servlet, JBoss(J2EE)… About 200 Threads run on MSS (for transport, timer, cluster…)
  • 13. Other problems related to SIP Retransmissions will occur, if response was sent late over 500ms with UDP transport In normal case, UDP transport will be used. If JVM was stopped long time by GC Call failure will be occurred and error handling may not work properly. SIP has many timers, they could not work properly. It’s relatively easy to retry with HTTP, but you would have to start over from scratch to initiate session with SIP
  • 14. Conclusion MSS will discard many objects in one session. When retransmissions of UDP messages occurred, Many threads runs at the same time Many objects are discarded CPU usage go up GC will be missed Full GC will run Fall in a vicious cycle
  • 15. How To Tune the Java VM
  • 16. Plan Reduce retransmissions of UDP Response time less than 200ms Measure the performance on tuned JVM 400call/sec(1440,000BHCA) Effective use of multiple CPU Most of server-machine have multiple CPU Reduce pause times by “Stop-The-World”
  • 17. Test Sequence UAC UAS Mobicnets INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 200/INVITE ACK ACK BYE BYE Established Session 200/BYE 200/BYE 10sec 30sec About 16,000 sessions will remain on JVM
  • 18. Recommended Sun Java VM Options -server -XX:+UseTLAB is enabled. -XX:+UseConcMarkSweepGC CMS GC reduce the “Stop the World”. -XX:+CMSIncrementalMode Enable the incremental mode. You should tune the below options -XX:CMSIncrementalDutyCycle=<N> -XX:CMSIncrementalDutyCycleMin=<N>
  • 19. Other performance options(1) -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 Object that related to SipSessions will NOT be collected in NewGC. This option will make the full NewSize available to every NewGC cycle. -XX:+UseParNewGC Enable a parallel young generation GC. (for multiple cpu machine) -XX:CMSInitiatingOccupancyFraction=75 Set the level at which the collection is started -XX:+CMSParallelRemarkEnabled Reduce remark pause with multi threads
  • 20. Other performance options (2) -XX:+UseStringCache Enables caching of commonly allocated strings -XX:+OptimizeStringConcat Optimize String concatenation operations where possible -XX:+UseCompressedStrings Use a byte[] for Strings which can be represented as pure ascii -XX:+UseCompressedOops Enables the use of compressed pointers for optimized 64-bit performance
  • 21. Data and results Default GC CMS GC without tuning the duty cycle CMS GC with tuning the duty cycle Add parallel NewGC and performance options Analyze: GC, CPU usage, failed call, succeeded call, Retransmissions, Average response time,…
  • 22. GC options (1) -Xms6g -Xmx6g -XX:PermSize=256m -XX:MaxPermSize=256m
  • 23. Default GC Over thousands failed calls And retransmissions “ Stop The World” about 8 seconds Thousands responses took more than 200ms
  • 24. GC options (2) -Xms6g -Xmx6g -XX:PermSize=256m -XX:MaxPermSize=256m -XX:UseConcMarkSweepGC -XX:+CMSIncrementalMode
  • 25. CMS GC without tuning the duty cycle 0 failed call GC pause time less than 100ms CPU usage increased Decreased time-consuming response
  • 26. GC options (3) -XX:UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=100 -XX:CMSIncrementalDutyCycleMin=100
  • 27. CMS GC with tuning the duty cycle CPU usage decreased Retransmissions decreased GC pause time less than 100ms Decreased time-consuming response
  • 28. GC options (4) -XX:-CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=100 -XX:CMSIncrementalDutyCycleMin=100 -XX:+UseStringCache -XX:+OptimizeStringConcat -XX:+UseCompressedStrings -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseCompressedOops -XX:CMSInitiatingOccupancyFraction=75 -XX:+CMSParallelRemarkEnabled
  • 29. Add parallel NewGC and performance options CPU usage decreased Memory usage decreased Retransmissions increased Increased time-consuming response
  • 30. Results Recommended VM options are useful. Reduce pause times No failed calls Reduce retransmissions Tuning options of the duty cycle are very useful Other performance options are slightly useful
  • 31. Developing SIP Servlet with frameworks
  • 32. SIP Servlet Frameworks Mobicents has 2 SIP Servlet Frameworks SSF (Spring Signaling Framework) Based on Spring Framework CTF(CDI-Telco-Framework) CDI Based framework These frameworks have same concept… Simplify SipServlets development We want to merge these framework’s functions and support many developers!
  • 34. How to develop SIP Servlet application with SSF
  • 35. Why using Spring Framework? Standard DI Container Familiar to many Java Developers Customizable Context SSF provide customized Context for SIP Servlet Many functionality modules are working on Spring Framework. You can create the converged application with Spring Framework modules.
  • 36. Create SIP Servlet with POJO @Component public class ProxyHandler { @Autowired ProxyBean proxyBean; @Autowired CheckRequireBean checkRequire; @SipServletRequestMapping(methods = { &quot;INVITE&quot;, &quot;UPDATE&quot;, &quot;MESSAGE&quot;, &quot;PUBLISH&quot; }) public void handleRequest(SipServletRequest req) throws Exception { // start checkRequire.handleRequest(req); if (req.isCommitted()) { return ; } proxyBean.startProxy(req); // end } … . Component Scan Autowired Original annotation Call bean’s method
  • 37. Easy to add functions Of course, you can use AOP function Try to add the Call-Blocking function to the proxy service. 
  • 38. Add Call-Blocking function (1) Create new POJO for Call-Blocking @Component public class CallBlockingBean { public void handleRequest(SipServletRequest req) throws IOException { if (isBlocked(req)) { SipServletResponse res = req.createResponse(SipServletResponse. SC_SERVICE_UNAVAILABLE ); res.send(); return ; } } … .
  • 39. Add Call-Blocking function(2) Create Aspect class for Advice @Aspect public class ProxyAround { @Autowired CallBlockingBean callBlocking; @Around(“execution(ProxyHandler.handleRequest(..)) && args(req)”) public void handleRequest(ProceedingJointPoint pjp, SipServletRequest req) throws IOException { callBlocking.handleRequest(req); pjp.proceed(new Object[]{req}); } … .
  • 40. Add Call-Blocking function (3) Add configurations for AOP <aop:aspectj-autoproxy proxy-target-class= &quot;true&quot; /> <context:component-scan base-package= &quot;org.mobicents.ssf.examples.sip.beans&quot; > <context:include-filter type= &quot;aspectj&quot; expression= &quot;org..ProxyAround*&quot; /> </context:component-scan> <context:component-scan base-package= &quot;org.mobicents.ssf.examples.sip.sipserver“/ > Just Do It! 
  • 42. CDI JSR-299 CDI is the Java standard for dependency injection and contextual lifecycle management, led by Gavin King for Red Hat , Inc. and is a Java Community Process (JCP) specification that integrates cleanly with the Java EE platform. Any Java EE 6-compliant application server provides support for JSR-299 (even the web profile). Loose coupling with strong typing Well-defined lifecycle for stateful objects bound to lifecycle contexts Support for Java EE modularity and the Java EE component architecture
  • 43. CDI-Telco-Framework Mobicents brings the power and productivity benefits of CDI into the Mobicents Sip Servlets platform providing dependency injection and contextual lifecycle management for converged HTTP/SIP applications.
  • 44. CDI-Telco-Framework Mission Statement simplify SipServlets development by introducing a clean programming model ease of development by making available SIP utilities out of the box providing dependency injection and contextual lifecycle management to the SipServlets.
  • 45. CDI-Telco-Framework public class SipRegistarClient { .... @Inject SipFactory sipFactory; protected void doRegister(@Observes @Register SipServletRequest req) throws ServletException, IOException {          .... register user here ... }
  • 46. Contact Naoki Nishihara [email_address] Jean Deruelle [email_address] Georges [email_address] Vladimir Ralev [email_address]
  • 49. Configuration mss-1.6.0-snapshot-jboss-jdk6-5.1.0GA-1103310643 With Simple B2BUA application SIPp as UAC & UAS Jdk1.6.0_24 RHEL5 2.6.18-164.el5
  • 50. Target server machine HP PROLIANT DL360 G6(504634-291) Intel(R) Xeon(R) CPU E5540 @ 2.53GHz stepping 05 4 core Memory: 32G

Editor's Notes

  • #3: At first I’m not very fluent in English. So I will look at my notes during the presentation. Please bear with me and feel free to interrupt me and ask any questions. All right, first of all, thanks for your coming this session. Today, I’d like to talk about tuning and development with sip servlet on mobicents. This is my first speech in English. And I participate in JUDCon for the first time too. Please be easy on me Let’s get started.
  • #4: This is agenda. First introduction Second I describe about SIP Application behavior and mobicents sip servlet container. Third How to tune the JavaVM for SIP Servlet Last How to develop SIP Servlet Application with frameworks
  • #5: Introduction I’m mobicents fellow. All you know, mobicents is the most popular OSS community for Telecom. I’ve joined to core team of mobicents since this March. And I’m contributing SSF to mobicents. SSF is for developing SIP Servlet Application with Spring Framework. My company, OKI has developed SIP Servlet and container since 2003 (two thousands and three) (After this, Introduce Jean)
  • #6: Next, The brief description of my company All you would not know OKI, but you may know OKI data. OKI is parent company of OKI data.:-0 Founded, January 1881 (eighteen, eighty one) Major operation is as you can see it.
  • #7: My current works are: Support Japan carriers They are evaluating the oss platform. They are usually very conservative and will be very sensitive and careful for managing and handling error and abnormal cases. But they are very important for platforms. We are analyzing and evaluating their requirements, and how can I feedback them to mobicents. Customize mobicents sip servlet for proprietary. Our customer requires Do not include internal IP address in SIP Header fields. Do not over 256 characters per line in SIP Header. Etceteras Developing customized sip load balancer for Japanese carrier.
  • #8: Let’s get down to business. #Return to the subject. Start to talk about Sip Servlet behavior
  • #9: 1 st , As you know. Some SIP messages will be sent for creating one session. INVITE, 180./INVITE, 200/INVITE, ACK, BYE, 200/BYE and etc…
  • #10: This is most basic b2bua sequence. 細かい質問があったら、 Jean に任せる。 At least, sip specification creates 2 dialogs, 6 transactions, 12 messages for one session. If UDP retransmissions occurred, more messages will be sent and create more objects and discard them
  • #11: In addition, many objects are created.
  • #12: For example, on mobicents sip servlets, This table is instance counts after 10,000 calls are established. These objects are top counts of remained objects related to jain-sip. Almost these objects are SIP header. There are short life time objects, or related to SipSession or SipApplicationSession Related objects will be left on JVM until SipSessions and SipApplicationSession are terminated. Heap will be filled with like these objects.
  • #13: As MSS own behavior, many threads run on MSS. For transport, timer, cluster, http, j2ee container… and so on For Jain-sip and sip-servlets stack, about 100 threads run by default settings. But you can configure and reduce them.
  • #14: SIP with UDP transport has a common problem due to retransmission. In normal case, UDP transport will be used. when sip response sent late over 500ms, retransmission of sip message will coccur. And If jvm was stopped long time by gc, Call failure will be occurred and error handling may not work properly. Or SIP has many timers, and they could not work properly. Retry with http is relatively easier than sip You would have to start over from scratch to initiate SIP session.
  • #15: From these behaviors, the results can be derived as follows. MSS will discard many objects in one session. When retransmissions of UDP messages occurred, Many threads runs at the same time CPU usage go up New GC will be missed Full GC will run If many retransmissions occurred, more objects will discard. GC will be missed more… And fall in a vicious cycle.
  • #16: For these reasons, I will introduce How to tune the JVM to avoid these problems.
  • #17: My plan is Reduce retransmissions of UDP Response time less than 200ms Measure the performance 400call/sec(1440,000BHCA Busy Hour Call Attempts) I want to use multiple cpu effectively Most of server-machine have multiple CPU, and I want to use multiple CPU well with the concurrent GC.
  • #18: This is test sequence that is basic b2bua sequence I described before. Wait 10 seconds after ringing response sent Wait 30 seconds after ACK request sent
  • #19: These are recommended Java VM Options. These options are set, you will reduce the “Stop the World” by GC. UsetTLAB is to use thread-local object allocation These options enable the concurrent mark sweep GC
  • #20: These are other recommended options for mss. When These options is enabled, mobicents sip servlet will work more stable.
  • #21: These are other recommended options These options are for optimization. SIP message parser will create many string objects. I thought these options will be useful for mss.
  • #22: I tried four patterns. And I measured GC, CPU usage, failed call, succeeded calls, retransmission, and response time.
  • #23: First These are almost default gc options for mss Heap memory is set to 6 giga bytes Permanent space size is 256 mega bytes
  • #24: Let see charts. CPU usage has many peaks, but average is 30% to 40% There are over thousands Retransmissions and failed calls “ Stop the world” is occurred. Many responses took more than 200ms.
  • #25: Next, Add the recommended VM options. They enable concurrent gc.
  • #26: These charts are CPU usage is increased, seems to be used more efficiently . Failed call is 0. CPU pause time less than 100ms. Time-consuming response is decreased! Almost happy to me. But many retransmission is still remained.
  • #27: Next I added the CMS tuning options. These options is enabled customized the duty cycle. 100% of time is used for concurrent collector. You will be able to use multiple CPU power more efficiently for GC.
  • #28: These are charts of result. Retransmission is decreased to about 10%. GC pause time is less than 100ms and heap utilization is decreased too. In addition, time-consuming response is decreased. These results is very satisfactory.
  • #29: Next I tried to add more options . These options are for optimization. For more information about these options, please see the Java VM documentation.
  • #30: The result are not any better the previous chart. CPU usage and memory usage is slightly decreased. But retransmissions and time-consuming response is increased.
  • #31: Conclusion Recommended options are useful. In addition, Options to tune the duty cycle are very useful. As mentioned before, multiple CPU can be used effectively. In addition, If you set optimization options instead of duty cycle options, You can see a similar effect. These results may also vary depending on machine spec However, it should be able to get the same effect by tuning the recently server machine Moreover, it is also effective to change the parameter of mss-sip-stack.properties to decrease retransmissions. These retransmissions are caused by udp packet errors. MSS is executing with one thread and one port for udp package transmission. Mobicents will improve this issu in the near future with NIO. まず、最初の VM オプションはかなり有効であることがおわかりいただけたと思います。 さらに duty cycle のチューニングをすることで、大きく性能があがったことがおわかりいただけたでしょう。 また、追加のオプションは少しは役に立ちましたが、 duty cycle のチューニングをしていなかった場合、同程度の性能向上を 行えたこともお伝えしておきます。 今回は VM のオプションを設定することでチューニングを施しました。 しあし、 MSS のオプションによっても性能を向上させることはできます。 再送は UDP の SC_RCVBUF の設定によっても減らすことが可能です。 再送が発生している時、 netstat で取得した情報から、 UDP のパケットエラーが発生していることに気づきました。 SC_RCVBUF の値を倍の値を 131072 にすることで、パケットエラーを減らすことができました。 しかし、0にすることはできませんでした。 この問題は、ある程度のマシンスペックがないと発生しないことが我々の試験でわかっています。 低スペックのマシンでは、それ以前に処理が間に合わずにエラーが発生するためです。 このため、この問題を解決するための方法について考察したことがあります。 MSS は UDP のパケット通信をひとつのポートおよびひとつのスレッドで処理しています。 Rport に対応させ、 UAC として動作するときにデフォルトの受信ポートと違うポートを使用してメッセージを送受信することで、 さらなる性能向上が見込めます。 実際に、 NIO を使用し、 UAC として動作する際にポートを開くようにトランスポートを改造してみたところ、パケットエラーを0にすることに成功しました。 ただ、試験用のためコミュニティに寄贈できるレベルのものを作成することができませんでした。 この提案はすでに行っており、近い将来に MSS で実装されるものと考えています。
  • #32: Let me show you developing sip servlet with frameworks.
  • #33: Mobicents has 2 sip servlet frameworks. First, My project, ssf This framework based on spring framework. Second CTF This framework based on cdi that is using standard api. These frameworks have same concept Simplify SipServlets development. The concept of sip servlet, web developer is also being able to facilitate development of sip. But all you know, sip servlet like the early days http servlet development, you have low-level api for sip development, And development is not easy. We want to accelerate application development.
  • #34: First, I talk about ssf.
  • #36: I selected to develop the framework based on spring, about 5 years ago. This because. Standard DI Container at the time Familiar to many Java Developers Spring has customizable context And SSF provides customized Context for SIP Servlet Many functionality modules are working on spring framework So you can create the converged application with Spring Framework modules
  • #37: This is a sample sip servlet with POJO. @Component annotation Spring will scan this pojo by this annotation. @Autowired annottion Spring will inject objects by this annotation @SipServletRequestMapping annotation SSF call this method by this annotation, when Sip request is received. This is very simple.
  • #38: Of course, you can use AOP function. Let’s add Call-Blocking function to this service.
  • #39: First create a new pojo for call-blocking. This logic is very simple. Determine whether you want to block requests And send response with specified error status.
  • #40: Second Create aspect class for advice This is a simple aspect class with annotations. If proxyhandler.handlerequest is called, this aspect class is called by spring.
  • #41: And setup the configrations for AOP. These configurations are basic settings for spring. Enable the aspectj fucntions And scan classes annotated with @AspectJ annotation.
  • #42: Next Introduce CTF by Jean
  • #47: Contact information Naoki, it’s me. SSF lead Jean MSS Lead Georges CDI Telco framework lead Vladimir Mobicents core developere and high availability support
  • #48: On March 11, 2011, the largest earthquake occurred and tremendous tsunami hit the eastern part of Japan. Immediately after this happened , many countries announced their support. We are in a difficult situation, many disaster victims have no place to live. But we will try to stand up and go on. Many many thanks from Japan Thanks for listening.
  翻译: