Tuning Linux systems

 

+

Search Tips   |   Advanced Search

 

Overview

  • timeout_timewait parameter

    Determines the time that must elapse before TCP/IP can release a closed connection and reuse its resources. This interval between closure and release is known as the TIME_WAIT state or twice the maximum segment lifetime (2MSL) state. During this time, reopening the connection to the client and server cost less than establishing a new connection. By reducing the value of this entry, TCP/IP can release closed connections faster, providing more resources for new connections. Adjust this parameter if the running application requires rapid release, the creation of new connections, and a low throughput due to many connections sitting in the TIME_WAIT state.

    To set the timeout_timewait parameter to 30 seconds:

    echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
    

  • SUSE Linux Enterprise Server 8 (SLES 8) SP2A - sched_yield_scale tuning

    • Description: The Linux scheduler is very sensitive to excessive context switching, so fixes are integrated into the SLES 8 kernel distribution to introduce delay when a thread yields processing. This fix is automatically enabled in SLES 8 SP3, but must be enabled explicitly in SLES 8 SP2A or later.

    • How to view or set:

      1. Upgrade your SLES 8 service pack to SP2A.

      2. Issue the sysctl -w sched_yield_scale=1 command .

    • Default value: 0

    • Recommended value: 1

  • RedHat Advanced Server 2.1 kernel update

    • Description: Kernel updates for RedHat Advanced Server 2.1 implemented changes that affect WAS performance, especially memory-to-memory HTTP session replication.

    • How to view or set:

      1. Issue the uname -a command

      2. If you are running any kernel prior to 2.4.9-e.23, upgrade at least to the RedHat Advanced Server 2.1 kernel, but preferably to the latest supported.

    • Default value: 2.4.9-e.3

    • Recommended value: 2.4.9-e.23

  • Linux file descriptors (ulimit)

    • Description: Number of open files that are supported. The default setting is typically sufficient for most applications. If the value set for this parameter is too low, a file open error, memory allocation failure, or connection establishment error might be displayed.

    • How to view or set: Check the UNIX reference pages on the ulimit command for the syntax of different shells. To set the ulimit command to 8000 for the KornShell shell (ksh), issue the ulimit -n 8000 command. Use the ulimit -a command to display the current values for all limitations on system resources.

    • Default value: For SUSE Linux Enterprise Server 9 (SLES 9), the default is 1024.

    • Recommended value: 8000

  • Connection backlog

    • Description: Change the following parameters when a high rate of incoming connection requests result in connection failures

      echo 3000 > /proc/sys/net/core/netdev_max_backlog
      echo 3000 > /proc/sys/net/core/somaxconn
      
      

  • TCP_KEEPALIVE_INTERVAL

    • Description: Determines the wait time between isAlive interval probes.

    • How to view or set: Issue the following command to set the value:

      cd /proc/sys/net/ipv4 edit tcp_keepalive_intv

    • Default value: 75 seconds

    • Recommended value: 15 seconds

  • TCP_KEEPALIVE_PROBES

    • Description: Determines the number of probes before timing out.

    • How to view or set: Issue the following command to set the value:

      edit tcp_keepalive_probes

    • Default value: 9 seconds

    • Recommended value: 5 seconds

  • Allocating large pages for Java virtual machine (JVM) heap (tested with SLES 9)

    Some applications require a very large heap for optimal performance. The CPU overhead of managing a large heap can be reduced by using the "large page" support provided by the CPU and operating system. The following example assumes a large page size of 4MB and a desired heap size of 2300MB.

    1. Set the following three settings by a sysctl.conf file.

      1. Set the number of large pages (2300MB = 575 * 4MB) by issuing the following command

        vm.nr_hugepages = 575
        

      2. Set the maximum shared segment size to 2300MB plus a little more (about 95MB) (2511724800 = 2300 * 1048576 + 100000000) by issuing the following command...

        kernal.shmmax = 2511724800
        

      3. Set the total amount of memory to be shared by issuing the following command

        kernal.shmall = 2511724800
        

    2. Specify the -Xlp JVM option so the JVM heap can utilize large pages.

    3. Set the Xmx JVM option to 2300MB.

    4. Relocate the program text to a lower virtual memory address to provide more address space for a larger heap. Run the following command to relocate the text in the script that invokes the JVM or in a .profile file

      echo "0x10000000" > /proc/self/mapped_base
      

 

Result

This tuning procedure improves performance of WAS on the Linux operating system.

 

What to do next

After tuning your operating system for performance, consult other tuning topics for various tuning tips.


 

Related Tasks


Tuning Windows systems
Tuning AIX systems
Tuning Solaris systems
Tuning HP-UX systems