Linux kernel settings for the workload generator systems

Some Linux® kernel settings must be permanently increased to run the driver workload.

To change the Linux kernel settings, add a shell script named performance.sh to directory /etc/profile.d. The processing of /etc/profile calls any shell scripts in the /etc/profile.d directory.

Shell script performance.sh should have these lines:
        echo "20000" > /proc/sys/net/core/netdev_max_backlog
        echo "20000" > /proc/sys/net/core/somaxconn
        echo "30"    > /proc/sys/net/ipv4/tcp_fin_timeout
        echo "20"    > /proc/sys/net/ipv4/tcp_syn_retries
        echo "20"    > /proc/sys/net/ipv4/tcp_synack_retries
        echo "3"     >/proc/sys/net/ipv4/conf/all/arp_ignore
        echo "2"     >/proc/sys/net/ipv4/conf/all/arp_announce
    ulimit -n 50000

The ulimit -n 50000 command sets the maximum number of open file descriptors (and therefore the maximum number of open files) to 50000. The default value is 30000.

The echo commands establish the network settings that produce the largest throughput without excessive time outs or retries. These are the echo command arguments:
netdev_max_backlog
Specifies the maximum number of incoming packets that can be enqueued for upper-layer processing. This is a global variable.
somaxconn
Specifies the maximum number of pending connection requests queued for any listening socket. These are set to high values that reflect the expectation of a high initial and high sustained number of both connections and incoming packets.
tcp_fin_timeout
Specifies how long to keep sockets in the state FIN-WAIT-2 if the socket is being closed. A longer timeout means that socket structures are held in memory longer, while the current timeout value of 30 seconds assumes reasonable completion times and conserves memory.
tcp_syn_retries
Specifies how many times to try to retransmit the initial SYN packet for an active TCP connection attempt. The current setting is 20, which means that there are 20 retransmission attempts before the connection times out. This can take several minutes, depending on the length of the retransmission attempt.
tcp_synack_retries
Specifies how many times to try to establish a passive TCP connection that was started by another host. This parameter is also set to a fairly small value for the same reasons that the tcp_syn_retries parameter was set to a fairly small value.
arp_ignore
Defines different modes for sending replies in response to received ARP requests that resolve local target IP addresses. An arp_ignore value of 3 means to not reply for local addresses configured within the host, but to reply only for global and link addresses.
arp_announce
Defines different restriction levels for announcing the local source IP address from IP packets in ARP requests sent on interface. An arp_announce value of 2 means to always use the best local address for this target, even if it means ignoring the source IP address and choosing the preferred IP address for the destination host.