![[Linux]](../images/linux.gif)
Tuning SIP servlets for Linux
Use tuning tips for Session Initiation Protocol (SIP) servlets when running on a Linux 2.6 kernel.
About this task
A Session Initiation Protocol (SIP) servlet under load
might retransmit messages or drop calls. The UDP socket queues might
fill. A review of the verbose garbage collection output might show
that there are fairly long garbage collection times, for example,
0.5 to 1.5 seconds. The cause of this problem is that the Ethernet
driver, Linux® operating system, WebSphere® Application Server, or
any combination of the items are not tuned for SIP applications. You
can apply the following levels of tuning.
Note: The following recommendations
have been tested on Red Hat Enterprise Linux 4 only and are provided
as is without any implied warranty.
Procedure
- Tuning the Linux Ethernet driver.
Linux Ethernet driver tuning begins by selecting the best Ethernet driver. For example, the HS20 blades recommended driver is the tg3-3.43b driver (or later). The following shell commands have been used to tune the Linux kernel Ethernet driver:
Depending upon the Ethernet driver that is installed, some of these options might need to change./sbin/ifconfig eth0 txqueuelen 2000 /sbin/ifconfig eth1 txqueuelen 2000 ethtool -s eth0 autoneg off speed 1000 duplex full ethtool -A eth0 autoneg off rx on tx on ethtool -C eth0 adaptive-rx off adaptive-tx off rx- usecs 20 rx-frames 5 tx-usecs 60 tx-frames 11 ethtool -G eth0 rx 511 rx-jumbo 255 tx 511
- Tuning the Linux kernel. Linux kernel tuning uses the following commands:
This configuration might not be optimum for a given application and you might need to adjust the configuration to achieve the best performance. However, you might use these values as a starting point.echo 16777216 > /proc/sys/net/core/rmem_max echo 2097152 > /proc/sys/net/core/rmem_default echo 16777216 > /proc/sys/net/core/wmem_max echo 2097152 > /proc/sys/net/core/wmem_default echo 10000000 > /proc/sys/net/core/optmem_max echo 4096 87380 16777216 > /proc/sys/net/ipv4/tcp_rmem echo 4096 87380 16777216 > /proc/sys/net/ipv4/tcp_wmem echo 8388608 8388608 8388608 > /proc/sys/net/ipv4/tcp_mem echo 400 > /proc/sys/net/unix/max_dgram_qlen echo 400 > /proc/sys/net/core/message_burst echo 2800 > /proc/sys/net/core/mod_cong echo 1000 > /proc/sys/net/core/lo_cong echo 200 > /proc/sys/net/core/no_cong echo 2900 > /proc/sys/net/core/no_cong_thresh echo 3000 > /proc/sys/net/core/netdev_max_backlog
- SIP tuning for WebSphere® Application Server. SIP
tuning for WebSphere Application Server is completed using the following steps:
- Create a separate thread pool for the SIP servlet container. Follow this path in the administrative console:
- Click Servers > Server Types > WebSphere application servers > server_name.
- Under Additional properties, click Thread Pools > New.
- In the Name field, enter SipContainer.
- In the Minimum Size and Maximum Size fields, enter 15. These values should be adequate for most applications.
- Click OK.
- Create custom properties for the SIP Servlet container. Follow this path in the administrative console:
- Click Servers > Server Types > WebSphere application servers > server_name.
- Click SIP container.
- Under Additional properties, click Custom Properties > New.
- In the Name field, enter javax.sip.max.object.pool.size.
- In the Value field, enter 1000.
- Click OK.
- In the Name field, enter max.tu.pool.size.
- In the Value field, enter 1000.
- Click OK.
- In the Name field, enter com.ibm.sip.sm.lnm.size.
- In the Value field, enter 8.
- Click OK.
- Create custom properties for the SIPUDP channel if User
Datagram Protocol (UDP) is the primary transport for SIP traffic. Follow this path in the administrative console:
- Click Servers > Server Types > WebSphere application servers > server_name.
- Click SIP container > Transport Chain > SIPCInboundDefaultUDP > UDP Inbound channel (UDP1).
- Under Additonal Properties, click Custom Properties > New.
- In the Name field, enter receiveBufferSizeSocket.
- In the Value field, enter 3000000.
- Click OK.
- In the Name field, enter sendBufferSizeSocket.
- In the Value field, enter 3000000.
- Specify the SIP servlet container general properties. Follow this path in the administrative console:
- Click Servers > Server Types > WebSphere application servers > server_name.
- Enter the Maximum application sessions value. The Maximum application sessions value can be calculated as: Maximum call hold time or session timeout x Call rate x Safety factor.
- Enter the Maximum messages per averaging period value. The Maximum messages per averaging period value can be calculated as: Maximum call hold time or session timeout x Maximum rate of SIP messages x Safety factor.
- Enter the Maximum dispatch queue size value. The Maximum dispatch queue size value can be calculated as: Maximum rate of SIP messages x Maximum latency in SIP processing x Safety factor.
- Set the thread pool to the newly created SIP container thread pool (to the drop down name "SipContainer").
- Tune the Java virtual machine (JVM) garbage collection
policy. Follow this path in the administrative console:
- Click Servers > Server Types > WebSphere application servers > server_name.
- Under Server Infrastructure, click Java and Process Management > Process Definition.
Click Control.
- Under Additional Properties, click Java Virtual Machine.
- In the Generic JVM arguments field, enter the following value as one continuous line: "-Xmn150m -Xgcpolicy:gencon -Xgc:scvNoAdaptiveTenure,scvTenureAge=1,stdGlobalCompactToSatisfyAllocate -Xcompactexplicitgc -XX:MaxDirectMemorySize=256000000".
Best practice:
- You might add a value of 1500 MB to the initial heap size and Maximum heap size fields.
- It is recommended that you enable the Verbose garbage collection option during performance testing or tuning operations.
- If your application allocates objects greater than 64 KB in size, it might be beneficial to reserve a large object area (LOA) in the heap. This is done by adding the JVM argument -Xloaminimum0.xy, where xy indicates the percentage of the heap to reserve for large objects. For more information about the JVM arguments, refer to the Java Diagnostics Guide 6.
- Create a separate thread pool for the SIP servlet container. Follow this path in the administrative console:


File name: tsip_tunelinux.html