Ulimit resources used by the shell startup process
1. Category:
Shell built-in commands
2. Syntax format:
Ulimit [-ACDFHLMNPSSTVW] [size]
3, Parameter Introduction:
-H sets the hardware resource limit.
-S sets the software resource limit.
-a displays all current resource limits.
-C Size: Sets the maximum value of the core file. Unit: Blocks
-D Size: Sets the maximum value for the data segment. Unit: Kbytes
-F Size: Sets the maximum value of the created file. Unit: Blocks
-L Size: Sets the maximum value of the locked process in memory. Unit: Kbytes
-M Size: Sets the maximum number of resident memory that can be used. Unit: Kbytes
-N Size: Sets the maximum number of file descriptors that the kernel can open at the same time. Unit: N
-P Size: Sets the maximum value of the pipe buffer. Unit: Kbytes
-S size: Sets the maximum value of the stack. Unit: Kbytes
-T size: Sets the maximum CPU usage time limit. Unit: Seconds
-V Size: Sets the maximum value for virtual memory. Unit: Kbytes
-U number: Set user max processes (max user processes)
4, Linux for each user, the system limits its maximum number of processes. To improve performance, you can set the maximum number of processes per Linux user according to the device resource situation, I set the maximum number of processes for a Linux user to 10,000:
Ulimit-u 10000
5. For Java applications that need to do many socket connections and keep them open, it is best to modify the number of files each process can open by using Ulimit-n xx, which is the default value of 1024. Increase the number of files that each process can open to 4096, and the default is 1024.
Ulimit-n 4096
6. Some important settings that are set to unlimited (unlimited) are:
Data segment Length: ulimit-d Unlimited
Maximum memory size: Ulimit-m Unlimited
Stack size: Ulimit-s Unlimited
CPU Time: Ulimit-t Unlimited
Virtual Memory: Ulimit-v Unlimited
7. The maximum number of processes and maximum file opening limits of the Linux system are lifted:
1) vi/etc/security/limits.conf, add the following line
* Soft Noproc 65535* hard noproc 65535* soft nofile 65535* hard nofile 65535
Description: * Represents for all users
Noproc represents the maximum number of processes
Nofile is the number of open files representing the maximum file
2), let SSH accept login program login, easy to view ulimit-a resource limit in SSH client:
A, Vi/etc/ssh/sshd_config
Change the value of Userlogin to Yes and remove the # comment
B. Restart the SSHD service:
/etc/init.d/sshd restart
3), modify the environment variable files for all Linux users:
Vi/etc/profile
Ulimit-u 10000ulimit-n 4096ulimit-d unlimitedulimit-m unlimitedulimit-s unlimitedulimit-t unlimitedulimit-v unlimit Edulimit-shn 65535
4), effective
Source/etc/profile
This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1836426
Maximum number of processes and maximum file opening limits for a Linux system