Tuning Linux Open Files

NOTES: a. This section is required only for Linux Operating Systems. Skip this chapter in case the Operating system is Solaris or Windows. b. The tuning mentioned in this chapter needs to be performed on all application servers. c. This needs to be performed by the system administrator or root user. d. In case the hard limit value is already set to a higher value than 65535 (on all the application servers), this chapter might be skipped.

Linux open files limits the number of file descriptors that any one process may open; the default limits are 1024 per process. These limits can prevent optimum performance of applications. For few high usage applications ulimit needs to be increased to a higher value say 65535. The open file limit is one of the limits that can be tuned with the ulimit command. The command ulimit -aS displays the current limit, and ulimit -aH displays the hard limit (above which the limit cannot be increased without tuning kernel parameters in /proc). The following is an example of the output of ulimit -aH. You can see that the current shell (and its children) is restricted to 1024 open file descriptors.

3. The system file descriptor limit is set in /proc/sys/fs/file-max. The following command will increase the limit to 65536: echo 65536 > /proc/sys/fs/file-max

4. Make sure open files (-n) is 65536 by typing the following command: ulimit –aH

5. Log out and log in again for the changes take effect. Increasing the File Descriptor Limit in WebSphere App Server:

navigate to WAS_ROOT/WebSphere/AppServer/profiles/AppSrv01/bin and open setupCmdLine.sh file in vi editor. Search for “ulimit” and change the value to 65536 and uncomment the line. Need to restart the server once ulimit set to 65536 to make the changes take effect. Verification Type in prompt

ulimit –aH

Ensure that open files (-n) is 65536.

Usually question comes as “what is the default open file limit for WebSphere?”

Its actually same as the systems file descriptor limit(ulimit -aH) till the point you set your own ulimit value in setupCmdLine.sh of WAS server.