Network Deployment (Distributed operating systems), v8.0 > Tune performance > Tune the application serving environment > Tune operating systems
Tune Linux systems
This topic describes how to tune the Linux operating system to optimize the performance of your WAS. When we have a performance concern, check the operating system settings to determine if these settings are appropriate for the application. Because the Linux operating system is not a WAS product, be aware that it can change and results can vary.
Procedure
Configure the following settings and variables according to your tuning needs:
- Changing TCP parameters
- Description: Linux offers a number of tunable TCP parameters whose default values might be sufficient for WAS. It might be necessary to tune these parameters in some exceptional cases. For example, you might reduce the number of sockets in specific states such as TIME_WAIT, modify the TCP keepalive operation, or modify other functions.
- To set...
Consult the detailed information available under "man tcp" under your Linux distribution.
- 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 earlier.
- How to view or set:
- Upgrade your SLES 8 service pack to SP2A.
- Issue the sysctl -w sched_yield_scale=1 command .
Default:
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:
- Issue the uname -a command
- 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:
2.4.9-e.3
- Recommended value: 2.4.9-e.23
- Linux file descriptors (ulimit)
- Description: Specifies the 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 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.
- To set...
Issue the following command to set the value:
echo 15 > /proc/sys/net/ipv4/tcp_keepalive_intvl- Default value: 75 seconds
- Recommended value: 15 seconds
- TCP_KEEPALIVE_PROBES
- Description: Determines the number of probes before timing out.
- To set...
Issue the following command to set the value:
echo 5 > /proc/sys/net/ipv4/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.
- Set the following three settings by a sysctl.conf file, typically located at /etc/sysctl.conf.
We must have root privilege access to modify this file. Also, verify the file is not marked as read-only before attempting to make changes.
- Set the number of large pages (2300MB = 575 * 4MB) by issuing the following command:
vm.nr_hugepages = 575- Set the maximum shared segment size to 2300MB plus a little more (about 95MB) (2511724800 = 2300MB * 1048576 bytes/MB + 100000000 bytes) :
kernel.shmmax = 2511724800- Set the total amount of memory to be shared by issuing the following command:
kernel.shmall = 2511724800
- Set the Xmx JVM option to 2300MB.
- 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
Results
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.
Tune Windows systems
Tune AIX systems
Tune Solaris systems
Tune HP-UX systems