Document toolboxDocument toolbox

Tuning the relay

Relay process memory allocation

It is possible to customize the JVM options for the JVM in which the relay will run. By default, it is set to 1GB but we recommend running it with at least 2 GB.

Ubuntu / CentOS

Edit the startup script located in /opt/devo/ng-relay/conf/relay/devo-ng-relay.jvmoptions and edit it with the desired memory allocation (heap size).

We recommend running it with at least 2 GB.

## JVM Options File ## The options are expressed as a list of new-line-separated JVM flag -Xms2G -Xmx2G

Take into account that the Process memory size value in the Relay config settings has to be lower than the process memory allocation here. Check Customizing the Devo Relay output connection to learn how to modify these settings.

Once the changes in the file are performed, restart the service.

sudo systemctl restart devo-ng-relay.service

docker-compose

Edit the .env file and update the memory allocation for the devo-ng-relay service.

## JVM Options # a space-separated quoted list of JVM flags JAVA_OPTS = "-Xmx2G -Xms2G"

Once the changes in the file are performed, execute the following command to apply the changes:

Relay input - How to avoid UDP data loss

UDP loss cannot be completely avoided as it is a non-reliable protocol. Due to this, TCP should be always the preferred way to send data to the relay. If there is no other choice, there are certain parameters that you can change in the OS to improve the situation.

Increase the maximum receive buffer to 500MB

  1. Edit the file /etc/sysctl.conf and add the following lines at the bottom:

  2. Then, apply the changes using this command:

  3. Finally, check that the changes have been applied using the following command:

    The output value should be 500000000.

Increase the UDP receive buffer sizes to at least 16MB

Edit the relay rules where UDP traffic is going to be sent and increase the UDP receive buffer sizes to at least 16MB. You may need to set bigger buffer sizes in order to not lose events, depending on the number of EPS sent to the relay and the average size of the events.

In a high traffic environment, a buffer size up to 256MB may be necessary.

You can monitor UDP packet loss using the following command:

Relay output - How to increase the socket send buffer size above the default OS maximum

In certain scenarios where the latency between the relay and the Devo collector/ELB is very high, it may be helpful to increase the socket send buffer above the default maximum value (most Linux distributions use 200 KB). 

In order to allow this, you need to change one parameter in the OS to increase this value.  

  1. Edit the file /etc/sysctl.conf and add the following lines at the bottom:

  2. Then, apply the changes using this command:

  3. Finally, check that the changes have been applied using the following command:

    The output value should be 1000000

  4. Change the TCP socket buffer size (kB) as explained here.

Â