SlideShare a Scribd company logo
1 of 53
Download to read offline
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                   MSS                    UAS

      INVITE
                                 INVITE
                                180/INVITE
      180/INVITE
                                200/INVITE
      200/INVITE                                   • 2 dialogs
       ACK                                         • 6 transactions
                                 ACK
                                                   • 12 messages
               Established Session

       BYE
                                 BYE
                                200/BYE
      200/BYE
SIP Servlet Behavior (2)
•  Many object will be generated in one
   sequence.
Created instances
   After 10,000 calls (NOT TERMINATED SESSION)
                                                 Instance counts

    gov.nist.core.	
NameValueList                :810,041
                    NameValue                    :330,015
                    HostPort                     :310,036
                    Host                         :310,036
                    DuplicateNameValueList       :290,049
                    MultiValueMapImpl            :290,049
gov.nist.javax.sip.	
                    SipURI                       :240,006
                    Authority                    :240,006
                    AddressImpl                  :210,003
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                   Mobicnets                UAS

                INVITE
                                           INVITE
                                          180/INVITE
                180/INVITE
                                          200/INVITE     10sec
                200/INVITE
                 ACK
                                           ACK

30sec                    Established Session

                 BYE
                                           BYE
                                          200/BYE
                200/BYE

          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
1.    Default GC
2.    CMS GC without tuning the duty cycle
3.    CMS GC with tuning the duty cycle
4.    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”     Thousands responses
about 8 seconds      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

CPU usage increased     0 failed call




                      Decreased
  GC pause time       time-consuming
  less than 100ms     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




                           Decreased
   GC pause time           time-consuming
   less than 100ms         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
                         Retransmissions increased




                              Increased
Memory usage decreased        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                                                              Component Scan
public class ProxyHandler {

 @Autowired                                                             Autowired
 ProxyBean proxyBean;

  @Autowired
  CheckRequireBean checkRequire;

  @SipServletRequestMapping(methods = { "INVITE", "UPDATE",             Original annotation
        "MESSAGE", "PUBLISH" })
  public void handleRequest(SipServletRequest req) throws Exception {
    // start
    checkRequire.handleRequest(req);                                    Call bean’s method

    if (req.isCommitted()) {
        return;
    }
    proxyBean.startProxy(req);

    // end
  }
  ….
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="true"/>
 
     <context:component-scan base-package="org.mobicents.ssf.examples.sip.beans">
      <context:include-filter type="aspectj" expression="org..ProxyAround*" />
     </context:component-scan>

     <context:component-scan base-package="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
  –  nisihara562@gmail.com
•  Jean Deruelle
  –  jean.deruelle@gmail.com
•  Georges
  –  gvagenas@gmail.com
•  Vladimir Ralev
  –  vladimir.ralev@gmail.com
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

More Related Content

What's hot

Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and Unicorn
Simon Bagreev
 

What's hot (20)

(SDD419) Amazon EC2 Networking Deep Dive and Best Practices | AWS re:Invent 2014
(SDD419) Amazon EC2 Networking Deep Dive and Best Practices | AWS re:Invent 2014(SDD419) Amazon EC2 Networking Deep Dive and Best Practices | AWS re:Invent 2014
(SDD419) Amazon EC2 Networking Deep Dive and Best Practices | AWS re:Invent 2014
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and Unicorn
 
Understanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and RaftUnderstanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and Raft
 
PV-Drivers for SeaBIOS using Upstream Qemu
PV-Drivers for SeaBIOS using Upstream QemuPV-Drivers for SeaBIOS using Upstream Qemu
PV-Drivers for SeaBIOS using Upstream Qemu
 
111214 node conf
111214 node conf111214 node conf
111214 node conf
 
Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77
 
Belvedere
BelvedereBelvedere
Belvedere
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof Networks
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalability
 
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV Foundation
 
Kubernetes the Very Hard Way. Velocity Berlin 2019
Kubernetes the Very Hard Way. Velocity Berlin 2019Kubernetes the Very Hard Way. Velocity Berlin 2019
Kubernetes the Very Hard Way. Velocity Berlin 2019
 
Hyperledger composer
Hyperledger composerHyperledger composer
Hyperledger composer
 
Docker在豆瓣的实践 刘天伟-20160709
Docker在豆瓣的实践 刘天伟-20160709Docker在豆瓣的实践 刘天伟-20160709
Docker在豆瓣的实践 刘天伟-20160709
 
CON411-R - Advanced network resource management on Amazon EKS
CON411-R - Advanced network resource management on Amazon EKSCON411-R - Advanced network resource management on Amazon EKS
CON411-R - Advanced network resource management on Amazon EKS
 

Similar to Tunning mobicent-jean deruelle

JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdf
RichHagarty
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 
Chotot k8s experiences.pptx
Chotot k8s experiences.pptxChotot k8s experiences.pptx
Chotot k8s experiences.pptx
arptit
 
Wireless Developing Wireless Monitoring and Control devices
Wireless Developing Wireless Monitoring and Control devicesWireless Developing Wireless Monitoring and Control devices
Wireless Developing Wireless Monitoring and Control devices
Aidan Venn MSc
 

Similar to Tunning mobicent-jean deruelle (20)

Tuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on MobicentsTuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on Mobicents
 
CMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 InstancesCMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 Instances
 
USAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdfUSAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdf
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
cosbench-openstack.pdf
cosbench-openstack.pdfcosbench-openstack.pdf
cosbench-openstack.pdf
 
Scaling Kubernetes to Support 50000 Services.pptx
Scaling Kubernetes to Support 50000 Services.pptxScaling Kubernetes to Support 50000 Services.pptx
Scaling Kubernetes to Support 50000 Services.pptx
 
JITServerTalk.pdf
JITServerTalk.pdfJITServerTalk.pdf
JITServerTalk.pdf
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Designing High Performance RTC Signaling Servers
Designing High Performance RTC Signaling ServersDesigning High Performance RTC Signaling Servers
Designing High Performance RTC Signaling Servers
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdf
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 
Scale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Chotot k8s experiences.pptx
Chotot k8s experiences.pptxChotot k8s experiences.pptx
Chotot k8s experiences.pptx
 
SHARE 2014, Pittsburgh CICS scalability
SHARE 2014, Pittsburgh CICS scalabilitySHARE 2014, Pittsburgh CICS scalability
SHARE 2014, Pittsburgh CICS scalability
 
SHARE 2014, Pittsburgh CICS scalability
SHARE 2014, Pittsburgh CICS scalabilitySHARE 2014, Pittsburgh CICS scalability
SHARE 2014, Pittsburgh CICS scalability
 
VMworld 2013: Extreme Performance Series: vCenter of the Universe
VMworld 2013: Extreme Performance Series: vCenter of the UniverseVMworld 2013: Extreme Performance Series: vCenter of the Universe
VMworld 2013: Extreme Performance Series: vCenter of the Universe
 
Kubernetes vs dockers swarm supporting onap oom on multi-cloud multi-stack en...
Kubernetes vs dockers swarm supporting onap oom on multi-cloud multi-stack en...Kubernetes vs dockers swarm supporting onap oom on multi-cloud multi-stack en...
Kubernetes vs dockers swarm supporting onap oom on multi-cloud multi-stack en...
 
Wireless Developing Wireless Monitoring and Control devices
Wireless Developing Wireless Monitoring and Control devicesWireless Developing Wireless Monitoring and Control devices
Wireless Developing Wireless Monitoring and Control devices
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Tunning mobicent-jean deruelle

  • 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 MSS UAS INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 200/INVITE • 2 dialogs ACK • 6 transactions ACK • 12 messages Established Session BYE BYE 200/BYE 200/BYE
  • 10. SIP Servlet Behavior (2) •  Many object will be generated in one sequence.
  • 11. Created instances After 10,000 calls (NOT TERMINATED SESSION) Instance counts gov.nist.core. NameValueList :810,041 NameValue :330,015 HostPort :310,036 Host :310,036 DuplicateNameValueList :290,049 MultiValueMapImpl :290,049 gov.nist.javax.sip. SipURI :240,006 Authority :240,006 AddressImpl :210,003
  • 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 Mobicnets UAS INVITE INVITE 180/INVITE 180/INVITE 200/INVITE 10sec 200/INVITE ACK ACK 30sec Established Session BYE BYE 200/BYE 200/BYE 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 1.  Default GC 2.  CMS GC without tuning the duty cycle 3.  CMS GC with tuning the duty cycle 4.  Add parallel NewGC and performance options Analyze: GC, CPU usage, failed call, succeeded call, Retransmissions, Average response time,…
  • 23. Default GC Over thousands failed calls And retransmissions “Stop The World” Thousands responses about 8 seconds took more than 200ms
  • 25. CMS GC without tuning the duty cycle CPU usage increased 0 failed call Decreased GC pause time time-consuming less than 100ms response
  • 27. CMS GC with tuning the duty cycle CPU usage decreased Retransmissions decreased Decreased GC pause time time-consuming less than 100ms response
  • 29. Add parallel NewGC and performance options CPU usage decreased Retransmissions increased Increased Memory usage decreased 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 Component Scan public class ProxyHandler { @Autowired Autowired ProxyBean proxyBean; @Autowired CheckRequireBean checkRequire; @SipServletRequestMapping(methods = { "INVITE", "UPDATE", Original annotation "MESSAGE", "PUBLISH" }) public void handleRequest(SipServletRequest req) throws Exception { // start checkRequire.handleRequest(req); Call bean’s method if (req.isCommitted()) { return; } proxyBean.startProxy(req); // end } ….
  • 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="true"/> <context:component-scan base-package="org.mobicents.ssf.examples.sip.beans"> <context:include-filter type="aspectj" expression="org..ProxyAround*" /> </context:component-scan> <context:component-scan base-package="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 –  nisihara562@gmail.com •  Jean Deruelle –  jean.deruelle@gmail.com •  Georges –  gvagenas@gmail.com •  Vladimir Ralev –  vladimir.ralev@gmail.com
  • 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