+

Search Tips   |   Advanced Search

 

Tune Linux systems

 


timeout_timewait

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.

Decrease this parameter if there are a lot connections sitting in TIME_WAIT state.

To monitor...

To set timeout_timewait to 30 seconds...


Linux file descriptors (ulimit)

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.

To display current values for all limitations on system resources.

To set ulimit to 8000 for the KornShell shell (ksh)...

Default value: 1024
Recommended value: 8000


Connection backlog

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


TCP_KEEPALIVE_INTERVAL

Wait time between isAlive interval probes.

To set:

Default value: 75 seconds
Recommended value: 15 seconds


TCP_KEEPALIVE_PROBES

Number of probes before timing out.

To set:

Default value: 9 seconds
Recommended value: 5 seconds


Allocate large pages for 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 that is 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, typically located at /etc/sysctl.conf.

    You must have root privilege access to modify this file. Also, verify the file is not marked as read-only before attempting to make changes.

    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 = 2300MB * 1048576 bytes/MB + 100000000 bytes) by issuing the following command:

        kernel.shmmax = 2511724800

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

        kernel.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 (0x10000000) to provide more address space for a larger heap. On SUSE Linux Enterprise Server 9 , 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


RedHat Advanced Server 2.1 kernel update

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

To 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


SUSE Linux Enterprise Server 8 SP2A - sched_yield_scale

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.

To set:

  1. Upgrade your SLES 8 service pack to SP2A.

  2. Run...

      sysctl -w sched_yield_scale=1

Default value: 0

Recommended value: 1

 

See also

Preparing Linux systems for installation
Tuning Windows systems
Tuning AIX systems
Tuning Solaris systems
Tuning HP-UX systems