Linux----Ulimit Limitations

Source: Internet
Author: User
Tags numeric value

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.