The format of etcsecuritylimitsconf [plain] limitsconf is as follows: & lt; domain & gt; & lt; type & gt; & lt; item & gt; & lt; value & gt; or: username | @ groupnametyperesourcelimitusernam/etc/security/limits. [plain] limits. the conf format is as follows: Or: username | @ groupname type resource limitusername | @ groupname: sets 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. For example, type: soft, hard and-soft indicate the setting values that are effective for the current system. hard indicates that the maximum soft limit that can be set in the system cannot be higher than har limit.-This indicates that both soft and hard are set. value. Resource: core-restrict kernel file size date-maximum data size fsize-maximum file size memlock-maximum lock memory address space 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-the maximum number of users allowed to log on to limits. make sure that the pam_limits.so file is added to the startup file. Check whether the/etc/pam. d/login file contains: session required/lib/security/pam_limits.so temporarily. it is applicable to logging on to the shell session through the ulimit command. Permanently, add a corresponding ulimit statement to one of the files read by the logon shell (for example ~ /. Profile), which is a shell-specific user resource file, or by editing/etc/security/limits. conf. What is a core file? when a program crashes, the stored images of the process are copied to the core file in the current working directory of the process. The core file is only a memory image (with debugging information added) and is mainly used for debugging. The core file is a binary file, and a corresponding tool is required to analyze the memory image when the program crashes. The default core file size is 0, so no file is created. You can use the ulimit command to view and modify the size of the core file. $ Ulimit-c0 $ ulimit-c 1000 $ ulimit-c1000-c specifies the size of the core file to be modified, and 1000 specifies the size of the core file. You can also set no limit on the size of the core file, for example, # ulimit-c unlimited # ulimit-cunlimited. if you want the modification to take effect permanently, you need to modify the configuration file, such. bash_profile,/etc/profile, or/etc/security/limits. conf. 2. nofile-maximum number of opened files [plain] * soft nofile 10000 # soft limit * hard nofile 10000 # hard limit for applications that require many socket connections and make them open, it is best to use ulimit-n, or set the nofile parameter to set the number of file descriptors higher than the default vi/etc/security/limits. conf modification with ulimit-n 2048 is only valid for the current shell. after exiting, it becomes invalid :!!!!!!!!!!!!!!!!! If program A is running, the value of ulimit-n is 1024, and then the value of ulimit-n is 2048, program B is running, the current shell user is exited, shell again, and then the C program is running; at this time, only Program B uses 2048, and other applications use 1024.
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