Setting the Open-File Limit for Linux/Unix
The open-file limit is a setting that controls the maximum number of open files for individual users. The default open-file limit is typically 1024, but can be set with the ulimit command by the root user. For Code Insight to function properly in a Linux or Unix environment, the open-file limit must be set to handle more than 50K files on each instance hosting the Core Server or a Scan Server.
Increasing the open-file limit is absolutely essential for Code Insight to function properly on Unix/Linux platforms.
When not running Code Insight as a service, you must use the procedure described here to set the open-file limit for individual Code Insight users or groups. If you do intend to run Code Insight as a service, you must set the open-file limit at the service level, using the procedure described in Opening the Code Insight Web User Interface. Best practice is to also set the open-file limit at the user or group level, as described here, should situations arise where Code Insight is not run as a service.
The following are types of open-file limits:
-
soft limit—Set in
/etc/security/limits.confby a normal user. -
hard limit—Set in
/etc/security/limits.confby root user. -
system wide limit—Set in
/etc/sysct1.confby root user.
Soft limits are the currently enforced limits; hard limits are the maximum limits on the system. The following procedure sets a soft and a hard open-file limit for user or group you specify. To run the procedure, you should log in as the root user so that you can set both limit types.
To set open file limits on an RHEL system, do the following:
-
In a command-line window on your instance, type
ulimit -ato see a list of current file limits. -
Locate the open files (-n) setting:
-
If the setting is less than 50K, continue to the next step.
-
If the setting is more than 50K, you do not need to perform this procedure.
-
-
Open the file
/etc/security/limits.conf, and add the following entries for each specific user or group as needed:<userName> soft nofile 65536
<userName> hard nofile 65536- or
@<groupName> soft nofile 65536
@<groupName> hard nofile 65536-
Alternatively, you can substitute
<userName>or @<group name>with the wildcard * for a default entry:* soft nofile 65536
* hard nofile 65536
-
Save the file and log in again for the changes to take effect.
-
On the command line, type
ulimit -a, and verify that the open files (-n) setting reads 65536.
Other distributions, such as a Ubuntu and CentOS, might require a different setting. See instructions for your specific Linux distribution and shell type.