Basically there are two types of limits:
A hard limit is the maximum allowed limit to a user or session, which is set by the superuser/root. A soft limit is the current effective value for the user or session. Which can increase by the user up to the hard limit.
Check for Current Limits
The ulimit command provides control over resources available to each user via a shell. You can use below command to to get the current settings. To view the current hard limit or soft limit use the following command.
Increase Limit for Current Session
Most operating systems can change the open-files limit for the current shell session using the ulimit -n command:
Increase per-user Limit
You can define per-user open file limit on a Debian based Linux system. To set per-user limit, edit /etc/security/limits.conf file in a text editor. Add the following values in file: Here we specifying separate limits which are 200000 for the user “jack” and 65535 will be applied for the rest of the users. You can change these values per your requirements. After that enable the pam_limits as followings: Add the following line:
Increase system-wide Limit
You can also set the limits system-wide by editing the sysctl configuration file. Edit sysctl.conf file: Add the following line: Then run the following command to apply the above changes: The above changes will increase the maximum number of files that can remain open system-wide. The specific user limit can’t be higher than the system-wide limit.