Summary of linux Resource limit levels

Source: Internet
Author: User

Summary of linux Resource limit levels

Linux resource restrictions can be divided into system-level and kernel-level:

First: system-level restrictions:

/Etc/security/limits. conf


The limits. conf format is as follows:
Username "@ groupname type resource limit
Username | @ groupname: Set the user name to be restricted. The group name is preceded by @ and the user name. You can also use wildcard * to restrict all users.
Type: soft, hard, and-. soft indicates the setting value that takes effect for the current system. Hard indicates the maximum value that can be set in the system. Soft cannot be more restrictive than hard. -Indicates that both soft and hard values are set.
Resource:
Core-restrict the size of kernel files
Date-maximum data size
Fsize-Maximum File Size
Memlock-maximum memory address space locked
Nofile-Maximum number of opened files
Rss-maximum persistent setting size
Stack-maximum stack size
Cpu-maximum CPU time in minutes
Noproc-Maximum number of processes
As-address space limit
Maxlogins-Maximum number of logins allowed by this user


To make the limits. conf file take effect, make sure that the pam_limits.so file is added to the Startup File.
View the/etc/pam. d/login file: (add if no)
Session required/lib/security/pam_limits.so
Note:
A lot of people have set limitc. conf and the test does not take effect. Most of the reasons are:
32-bit system session required/lib/security/pam_limits.so
64-bit system session required/lib64/security/pam_limits.so

Second, restrictions on the application software level:

This is common. For example, Nginx is better in this area.

Third: kernel-level restrictions:

This is a lot of information.

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.