SlideShare a Scribd company logo
1 of 53
 
Tuning and development with SIP Servlet on Mobicents Naoki Nishihara OKI Electric Industry Co.,Ltd Jean Deruelle Mobicents Sip Servlets Lead
Agenda ,[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object]
About OKI ,[object Object],[object Object],[object Object],[object Object]
Current works ,[object Object],[object Object],[object Object],[object Object]
SIP Servlet Behavior
SIP Servlet Behavior (1) ,[object Object]
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 ,[object Object],[object Object],[object Object]
SIP Servlet Behavior (2) ,[object Object]
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 ,[object Object],About 200 Threads run on MSS (for transport, timer, cluster…)
Other problems related to SIP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Fall in a vicious cycle
How To Tune the Java VM
Plan ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other performance options(1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other performance options (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data and results ,[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Developing SIP Servlet with frameworks
SIP Servlet Frameworks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Signaling Framework SSF
How to develop SIP Servlet application with SSF
Why using Spring Framework? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Create SIP Servlet with POJO @Component public   class  ProxyHandler { @Autowired ProxyBean proxyBean; @Autowired CheckRequireBean checkRequire; @SipServletRequestMapping(methods = { "INVITE", "UPDATE", "MESSAGE", "PUBLISH" }) 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 ,[object Object],[object Object]
Add Call-Blocking function (1) ,[object Object],@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) ,[object Object],@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) ,[object Object],<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 ,[object Object],[object Object],[object Object],[object Object]
CDI-Telco-Framework  ,[object Object]
CDI-Telco-Framework  ,[object Object],[object Object],[object Object],[object Object]
CDI-Telco-Framework  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Contact ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Gratitude
Appendix
Configuration ,[object Object],[object Object],[object Object],[object Object],[object Object]
Target server machine ,[object Object],[object Object],[object Object],[object Object]
Default GC
Long Load
Over Load

More Related Content

What's hot

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
 
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
 

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
 
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
 
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
 
BEST REST in OpenStack
BEST REST in OpenStackBEST REST in OpenStack
BEST REST in OpenStack
 
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!
 
ClueCon 2017
ClueCon 2017ClueCon 2017
ClueCon 2017
 
SIP Testing with FreeSWITCH
SIP Testing with FreeSWITCHSIP Testing with FreeSWITCH
SIP Testing with FreeSWITCH
 
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
 
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
 
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
 
IoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & SparkIoT with Apache ActiveMQ, Camel & Spark
IoT with Apache ActiveMQ, Camel & Spark
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
 
Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
 
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
 
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
 
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
 
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
 
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
 
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...
 

Viewers also liked

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
 
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
 

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
 
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
 
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...
 
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...
 
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
 
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
 

Similar to Tuning and development with SIP Servlets on Mobicents

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
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
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
 

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
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Red Hat Agile integration workshop - Atlanta
Red Hat Agile integration workshop - AtlantaRed Hat Agile integration workshop - Atlanta
Red Hat Agile integration workshop - Atlanta
 
Agile integration workshop Atlanta
Agile integration workshop   AtlantaAgile integration workshop   Atlanta
Agile integration workshop Atlanta
 
Camel_From_The_Field
Camel_From_The_FieldCamel_From_The_Field
Camel_From_The_Field
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
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
 
murakumo Cloud Controller
murakumo Cloud Controllermurakumo Cloud Controller
murakumo Cloud Controller
 
NETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesNETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network Devices
 
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...
 
JAX London 2015: Java vs Nodejs
JAX London 2015: Java vs NodejsJAX London 2015: Java vs Nodejs
JAX London 2015: Java vs Nodejs
 
Java vs. Java Script for enterprise web applications - Chris Bailey
Java vs. Java Script for enterprise web applications - Chris BaileyJava vs. Java Script for enterprise web applications - Chris Bailey
Java vs. Java Script for enterprise web applications - Chris Bailey
 
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
 
WebServices in ServiceMix with CXF
WebServices in ServiceMix with CXFWebServices in ServiceMix with CXF
WebServices in ServiceMix with CXF
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Spring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - BostonSpring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - Boston
 
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
 

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 

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.
  • 4.
  • 5.
  • 6.
  • 8.
  • 9.
  • 10.
  • 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.
  • 13.
  • 14.
  • 15. How To Tune the Java VM
  • 16.
  • 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.
  • 19.
  • 20.
  • 21.
  • 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.
  • 31. Developing SIP Servlet with frameworks
  • 32.
  • 34. How to develop SIP Servlet application with SSF
  • 35.
  • 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.
  • 38.
  • 39.
  • 40.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 49.
  • 50.

Editor's Notes

  1. 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.
  2. 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
  3. 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)
  4. 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.
  5. 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.
  6. Let’s get down to business. #Return to the subject. Start to talk about Sip Servlet behavior
  7. 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…
  8. 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
  9. In addition, many objects are created.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. For these reasons, I will introduce How to tune the JVM to avoid these problems.
  15. 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.
  16. 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
  17. 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
  18. These are other recommended options for mss. When These options is enabled, mobicents sip servlet will work more stable.
  19. 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.
  20. I tried four patterns. And I measured GC, CPU usage, failed call, succeeded calls, retransmission, and response time.
  21. First These are almost default gc options for mss Heap memory is set to 6 giga bytes Permanent space size is 256 mega bytes
  22. 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.
  23. Next, Add the recommended VM options. They enable concurrent gc.
  24. 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.
  25. 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.
  26. 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.
  27. Next I tried to add more options . These options are for optimization. For more information about these options, please see the Java VM documentation.
  28. 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.
  29. 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 で実装されるものと考えています。
  30. Let me show you developing sip servlet with frameworks.
  31. 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.
  32. First, I talk about ssf.
  33. 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
  34. 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.
  35. Of course, you can use AOP function. Let’s add Call-Blocking function to this service.
  36. 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.
  37. 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.
  38. And setup the configrations for AOP. These configurations are basic settings for spring. Enable the aspectj fucntions And scan classes annotated with @AspectJ annotation.
  39. Next Introduce CTF by Jean
  40. Contact information Naoki, it’s me. SSF lead Jean MSS Lead Georges CDI Telco framework lead Vladimir Mobicents core developere and high availability support
  41. 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.