Sidebar

What environment options should I set when running QIE in a linux environment such as Ubuntu or CentOS?

0 votes
455 views
asked Aug 24, 2020 by ben-s-7515 (12,640 points)
I am running QIE in a linux environment.  Are there any considerations for a linux environment that I need to take into account.

1 Answer

0 votes

QIE is able to run in any environment that supports a JVM.  However, when running in linux there are a few things that users of the engine have run into.  Some simple changes to configuration will allow you to avoid issues when running in linux.

Max Open Files

First, the max_open_file limit is the biggest offender for linux environment.  Often when the max file handle limit is exceeded, QIE will throw different types of exceptions, some of them make it hard to know that it is the max_open_file limit that caused the exception (Ex. sporadic UnknownHostException's).
We recommend setting the hard and soft max_open_file limit to 100,000-200,000 to prevent these types of issues.  In high volume environments, you could go higher.
To check the limit on the QIE process, you first have to find the PID for QIE.  This can be done by executing the command:

ps -ef |grep qie | grep -v grep

The output will contain two processes, the first is the qieLauncher, and the second is the QIE service itself.  Note the PID (second value on the line).  Now you can execute the following command to get the current limits: (NOTE: In the following commands replace {PID} with the PID value from this command).

cat /proc/{PID}/limits

Now find the limit 'Max open files' and this tells you what the current value is.
To update this value on the running process execute the following:

sudo prlimit --pid {PID} --nofile=200000:200000

This changes the value of the running process without having to restart the process itself.

Finally, you will want to change the system configuration so that when the server is restarted, the new max_open_file limit is applied.  In most environments, you change this value by editing the /etc/security/limits.conf file and add the following two lines:

* hard nofile 200000
* soft nofile 200000

We have found that in Amazon EC2, you will also need to edit both the /etc/systemd/system.conf and /etc/systemd/user.conf and change the following line:

#DefaultLimitNOFILE=
DefaultLimitNOFILE=200000

 

Max TCP Connections

In some linux environment that have a very high volume of TCP connection such as an HTTP receiver processing over 2,000,000 http requests per day then adjusting the TCP network settings in the environment can help.

so_max_conn
This defines how many connections can be established to the host server (linux) but have not yet been picked up by the application (QIE).  Sometimes increasing this value can keep connections from getting dropped.  We can dynamically change this value without rebooting by executing the following:

sudo sysctl -w net.core.somaxconn=2048

To make this change after a reboot, we will need to add the following line to the bottom of the /etc/sysctl.conf file:

net.core.somaxconn=2048

ip_local_port_range
This defines the local port range that can be used for outgoing connections.  Because a port remains in use after closing for the close_wait_timeout period it is possible to see exceptions when opening connections to other systems for a web service call.  We can dynamically change this value without rebooting by executing the following command:

sudo sysctl -w net.ipv4.ip_local_port_range="1024 65535"

To make this change after a reboot, we will need to add the following line to the bottom of the /etc/sysctl.conf file:

net.ipv4.ip_local_port_range="1024 65535"

 

DNS Configuration

The current DNS configuration could cause un-needed traffic from the linux environment to the DNS servers.  Also, only have a single DNS server can present problems when the only configured DNS server experiences issues.  To midigate this issue, make sure to have a primary and secondary DNS server configured.  To enable DNS cache (in environments like Amazon EC2), it is recommended that dnsmasq be installed to help.  (Notes on Amazon EC2 DNS issues can be found here.)

answered Aug 24, 2020 by ben-s-7515 (12,640 points)
...