ULIMIT-A displays various restrictions for the current user.
The numeric value of ULIMIT-N indicates the number of files each process can open.
In general, the value of Ulimit-n is 1024.
When the number of files opened by a process exceeds this limit, the process exits.
Therefore, there are times when we need to modify this limit.
If we are just ordinary users, just temporarily modify the Ulimit-n, can be modified directly from the shell command (ulimit-n 1024000). However, this setting is temporarily reserved! When we exit bash, the value reverts to the original value.
If you want to permanently modify the ulimit, you need to modify/etc/security/limits.conf.
Vim/etc/security/limits.conf
# Add the following line
* Soft Nofile 4100
* Hard Nofile 4100
The following is a description:
* Represents for all users
Noproc represents the maximum number of processes
Nofile is the number of open files representing the maximum file
To add a format:
username| @groupname type resource limit
username| @groupname : Sets the user name that needs to be restricted, the group name is preceded by the @ and the user name differs. You can also use the wildcard character * to restrict all users.
Type: Soft,hard and-,soft refer to the setting values that are currently in effect for the system. Hard indicates the maximum value that can be set in the system. The soft limit cannot be higher than the Har limit. -The soft and hard values are also set.
Resource
Core-Limit the size of kernel files (KB)
Date-Maximum data size (KB)
Fsize-Maximum file size (KB)
Memlock-Maximum lock memory address space (KB)
Nofile-Maximum number of open files
RSS-Maximum persistent setting size (KB)
Stack-Maximum stack size (KB)
CPU-Maximum CPU time in minutes
Noproc-Maximum number of processes
As-address space limitations
Maxlogins-Maximum number of logons allowed by this user
After the file is saved, you need to log in again to take effect, if you do not need to re-login to restart.
Linux----Ulimit Limitations