ultraesb menu icon

Production Deployment Best Practices

Version: 17.07

When a Production deployment is being done, there are some best practices to be followed in order to get the maximum performance from UltraESB-X.

Operating System and Hardware

Operating system and hardware configuration is a major fact to be considered for a serious production deployment.

Linux Operating system using a Kernel version 2.6 or later

The UltraESB-X will perform best on a Linux operating system using a Kernel of version 2.6 or later, where the epoll facility is available for Java NIO. On systems without support for epoll, the NIO subsystem will fall-back to using a traditional poll-based selector. A Linux Kernel 2.1 or later is required to enable the use of the sendfile system call for zero-copy proxying with DMA. AdroitLogic recommends Debian / Ubuntu Linux servers as the most suitable OS for the UltraESB, followed by RHEL/CentOS.

The following system configurations should be performed to enable best performance.

/etc/sysctl.conf file

net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_fin_timeout = 30
fs.file-max = 2097152
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_syncookies = 0
net.core.somaxconn = 1024

/etc/security/limits.conf file

soft nofile 65535
hard nofile 65535

/etc/pam.d/common-session file

session required pam_limits.so

Log files should generally be located on a local disk drive. Multiple Network cards maybe used. Ensure that Gigabit Networking is enabled and that the Network card offloading capabilities are enabled.

Selecting the UltraESB-X Distribution

It is recommended that the UltraESB-X Full Distribution be used to set-up a production deployment. You would receive the direct links to the download when you register to download the distribution. The full distribution is designed for the most common production deployment scenario, and includes the metrics engine, management server etc.

Additionally only the Zookeeper and XTerm utilities can be downloaded as the Tools Distribution and installed on any machine/s requiring access to manage the production nodes. If the production deployment requires any custom libraries for any Ultra Project running within it (e.g. javax libraries), these JAR files needs to be made available at the ULTRA_HOME/lib/custom directory of each production node.

UltraESB-X configuration

The UltraESB-X configuration maybe optimized and tuned with the following options in general. However, it should be noted that any custom code developed by a user should be adequately tested for performance and memory utilization etc before being deployed onto a production instance, as a failing user component has the potential to put down an ESB node.

Thus the usual practice should be to test the user components for functionality, performance and memory usage, and stress testing, followed by monitoring the system and tuning aspects to suit the workload the the use cases handled by the system.

Tuning of the File-Store and RAM Disk

If any Ultra Projects are using File-Store feature directly or indirectly (through any connector/processor), the File Store and the corresponding RAM Disk should be tuned for better performance. Please refer the documentation on File Store Feature on these configuration details.

Changing Environment Mode

When deploying UltraESB-X in production, environment mode should be set as PROD. This can be done by setting the mode property of the environment bean in the server.xml file as shown below.

<bean id="environment" class="org.adroitlogic.x.core.Environment">
    <constructor-arg name="nodeName" value="localhost"/>
    <property name="mode" value="PROD"/>    (1)
    <property name="projectBaseDir" value="projects"/>
    <property name="tmpDir" value="tmp"/>
</bean>

Advanced Configuration for Production Deployments

Its advisable to run the UltraESB process under a non-privileged user account. On Linux systems you could create a new account without the login privilege as follows.

Ubuntu/Debian

sudo adduser adrt --disabled-login

CentOS/RHEL

sudo adduser adrt
sudo usermod -s /sbin/nologin adrt

Configuring Automatic Startup/Shutdown

You may create a script to start the UltraESB-X at boot time. On Debian/Ubuntu systems, this involves creating an LSB script at /etc/init.d as described below. First create a file /etc/init.d/ultraesbx as root with the following contents.

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          ultraesb
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop AdroitLogic UltraESB-X
### END INIT INFO
#
# ultraesb        This init.d script is used to start the UltraESB-X
#
APP=ultraesb
#############################################################
#                      DEFINE THE FOLLOWING                 #
#############################################################
# Name of the user to run as
USER=adrt
# Location of application's bin directory
ULTRA_HOME=/opt/ultraesb
# Location of Java JDK with the ** unlimited strength ** policy files applied
export JAVA_HOME=/opt/jdk
case "$1" in
  # Start command
  start)
    echo "Starting $APP"
    /bin/su -m $USER -c "$ULTRA_HOME/bin/ultraesbx.sh start &> /dev/null"
    ;;
  # Stop command
  stop)
    echo "Stopping $APP"
    /bin/su -m $USER -c "$ULTRA_HOME/bin/ultraesbx.sh stop &> /dev/null"
    echo "$APP stopped successfully"
    ;;
  # Status command
  status)
    /bin/su -m $USER -c "$ULTRA_HOME/bin/ultraesbx.sh status"
    ;;
   # Restart command
   restart | force-reload)
        $0 stop
        sleep 5
        $0 start
        ;;
  *)
    echo "Usage: /etc/init.d/$APP {start|restart|stop|status}"
    exit 1
    ;;
esac
exit 0

Next, make this file executable using the command sudo chmod +x /etc/init.d/ultraesbx). This script invokes the `bin/ultraesbx.sh script to start/stop/restart the UltraESB-X or show its current status. Hence specify the Linux username under which the UltraESB would be executed, the UltraESB home directory ULTRA_HOME and the JAVA_HOME directory. Make sure that the JDK has been updated with the unlimited strength policy files for cryptography.

Next, register the LSB script to the host machine as follows for Ubuntu/Debian, or using chkconfig –add ultraesbx for RHEL/CentOS.

adrt@pub:/etc/init.d$ sudo update-rc.d ultraesb defaults
    Adding system startup for /etc/init.d/ultraesbx ...
       /etc/rc0.d/K20ultraesb -> ../init.d/ultraesbx
       /etc/rc1.d/K20ultraesb -> ../init.d/ultraesbx
       /etc/rc6.d/K20ultraesb -> ../init.d/ultraesbx
       /etc/rc2.d/S20ultraesb -> ../init.d/ultraesbx
       /etc/rc3.d/S20ultraesb -> ../init.d/ultraesbx
       /etc/rc4.d/S20ultraesb -> ../init.d/ultraesbx
       /etc/rc5.d/S20ultraesb -> ../init.d/ultraesbx

Note that the conf/wrapper.conf file contains the application level Java property configuration aspects such as heap memory sizes, system properties, etc. Also specify the full path to the java executable in the conf/wrapper.conf as follows.

..
# Java Application
wrapper.java.command=/opt/jdk/bin/java
..

You should now be able to start/stop/restart or check the status of the UltraESB-X as follows.

adrt@pub:/etc/init.d$ sudo /etc/init.d/ultraesbx start
Starting ultraesb

adrt@pub:/etc/init.d$ sudo /etc/init.d/ultraesbx status
AdroitLogic - UltraESB is running (2124).

adrt@pub:/etc/init.d$ sudo /etc/init.d/ultraesbx stop
Stopping ultraesb
ultraesb stopped successfully

adrt@pub:/etc/init.d$ sudo /etc/init.d/ultraesbx status
AdroitLogic - UltraESB is not running.
In this topic
In this topic
Contact Us