Document toolboxDocument toolbox

.Tuning the relay vv7.0.8

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. 


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:

    # Maximum socket receive buffer size (500MB) 
    net.core.rmem_max=500000000
  2. Then, apply the changes using this command:

    sudo sysctl -p /etc/sysctl.conf
  3. Finally, check that the changes have been applied using the following command:

    sudo sysctl -n net.core.rmem_max

    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:

# netstat -su | grep "receive errors"

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:

    # Maximum socket send buffer size (1 MB)
    net.core.wmem_max=1000000
  2. Then, apply the changes using this command:

    sudo sysctl -p /etc/sysctl.conf
  3. Finally, check that the changes have been applied using the following command:

    sudo sysctl -n net.core.wmem_max
    The output value should be 1000000
  4. Change the TCP socket buffer size (kB) as explained here.