WAS v8.5 > Tune performance > Tune the application serving environment > Tune operating systemsTune Linux systems
This topic describes how to tune the Linux operating system to optimize the performance of your WebSphere Application Server.
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.
Configure the following settings and variables according to your tuning needs:
- Change TCP parameters
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.
- How to view or 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
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
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)
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: For SUSE Linux Enterprise Server 9 (SLES 9), the default is 1024.
- Recommended value: 8000
- Connection backlog
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
Determines the wait time between isAlive interval probes.
- How to view or set: Issue the following command to set the value:
echo 15 > /proc/sys/net/ipv4/tcp_keepalive_intvl
- Default: 75 seconds
- Recommended value: 15 seconds
- TCP_KEEPALIVE_PROBES
Determines the number of probes before timing out.
- How to view or set: Issue the following command to set the value:
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes
- Default: 9 seconds
- Recommended value: 5 seconds
- Allocating 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 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.
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.
- 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) by issuing the following command:
kernel.shmmax = 2511724800
- Set the total number of memory page to be shared by issuing the following command:
kernel.shmall = ceil(shmmax/page_size)
This parameter sets the total number of shared memory pages that can be used system wide. Therefore, the value specified for the shmall parameter should always be at least ceil(shmmax/page_size) pages.
- 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.
After tuning your operating system for performance, consult other tuning topics for various tuning tips.
Related
Tune Windows systems
Tune AIX systems
Tune Solaris systems
Tune HP-UX systems