Linux ulimit command usage parsing

  
Learn how to use the ulimit command.
Function Description: Control the resources of the shell program.
Syntax: ulimit [-aHS][-c
Note: ulimit is a shell built-in directive that can be used to control the resources of the shell execution program.
Parameter:
The code is as follows:
-a Displays the current resource limit settings.
-c
-d <data section size> The maximum value of the program data section, in KB.
-f <file size> The largest file that a shell can create, in blocks.
-H Set the hard limit of the resource, which is the limit set by the administrator.
-m <memory size> Specifies the upper limit of the available memory in KB.
-n <number of files> Specifies the maximum number of files that can be opened at the same time.
-p <buffer size> Specifies the size of the pipe buffer in 512 bytes.
-s <Stack Size> Specifies the upper limit of the stack in KB.
-S Set the elastic limit of the resource.
-t
-u <number of programs> The maximum number of programs that a user can open.
-v <virtual memory size> Specifies the maximum amount of virtual memory that can be used, in KB.
ulimit -a is used to display the current various user process restrictions.
Linux For each user, the system limits its maximum number of processes. To improve performance, you can set the maximum number of processes for each linux user based on device resources.
For example, set the maximum number of processes for a linux user to 10000:
ulimit -u 10000
For Java applications that need to do many socket connections and make them open,
It is best to modify the number of files that can be opened per process by using ulimit -n xx. The default value is 1024.
ulimit -n 4096 Increase the number of files that can be opened per process to 4096, the default is 1024
Some other important settings that are recommended to be unlimited (limited) are:
Copy Code
The code is as follows:
Data segment length: ulimit -d unlimited
Maximum memory size: ulimit -m unlimited
Copyright © Windows knowledge All Rights Reserved