Ulimit command parameters and usage description: controls shell program resources. Note: ulimit is a shell built-in command that can be used to control shell execution program resources. Parameter:-a shows the current resource limit settings. -C: sets the maximum value of the core file in blocks ....
Ulimit command parameters and usage description: controls shell program resources. Note: ulimit is a shell built-in command that can be used to control shell execution program resources. Parameters:-a displays the current resource limit settings. -C sets the maximum value of the core file, in blocks. -D <数据节区大小> Maximum value of the program data section, in KB. -F <文件大小> The largest file that can be created by shell, in blocks. -H: Set the hard limit of resources, that is, the limit set by the administrator. -M <内存大小> Specify the maximum memory available, in KB. -N <文件数目> Specifies the maximum number of files that can be enabled at the same time. -P <缓冲区大小> The size of the media transcoding queue buffer, in 512 bytes. -S <堆叠大小> Specifies the upper limit of the stack, in KB. -S: Set the elastic limit of resources. -T specifies the maximum CPU usage time, in seconds. -U <程序数目> The maximum number of programs that a user can enable. -V <虚拟内存大小> Specifies the upper limit of the virtual memory that can be used, in KB. Www.2cto.com ulimit-a to view all the limits. 01 core file size (blocks,-c) 002 data seg size (kbytes,-d) unlimited03scheduling priority (-e) 004 file size (blocks,-f) unlimited05pending signals (-I) 25659006max locked memory (kbytes,-l) 6407max memory size (kbytes,-m) unlimited08open files (-n) 102409 pipe size (512 bytes,-p) 810 POSIX message queues (bytes,-q) 81920011real-time priority (-r) 012 stack size (k Bytes,-s) 1024013cpu time (seconds,-t) unlimited14max user processes (-u) 8092015 virtual memory (kbytes,-v) unlimited16file locks (-x) unlimited: The ulimit-HSn 65536 command can be used immediately. ulimit-u 80920 does not take effect immediately in centos 6.2. you also need to modify vim/etc/security/limits. d/90-nproc.conf should be caused by the new feature www.2cto.com 1 # Default limit for number of user's processes to prevent2 # accidental fork bombs.3 # See rhbz #432903 for reasoning.4 5 * Soft nproc 80920 note:/etc/security/limits. conf www.2cto.com limits. how conf works: limits. the backend of conf works like this: limits. conf is the configuration file of pam_limits.so, and then/etc/pam. d/the application under calls pam _***. so module. For example, when a user accesses the server, the service program sends the request to the PAM module. the PAM module sends the request to/etc/pam according to the service name. d Directory, select a corresponding service file, and then select a specific PAM module based on the service file content for processing. Limits. conf format 01 # Can be: 02 #-an user name03 #-a group name, with @ group syntax04 #-the wildcard *, for default entry05 #-the wildcard %, can be also used with % group syntax, 06 # for maxlogin limit07 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. 08 # Can have the two values: 09 #-"soft" for enforcing the soft limits10 #-"hard" for enforcing hard limits11hard indicates the maximum value that can be set in the system. Soft cannot be more restrictive than hard. Www.2cto.com 12 # Can be one of the following: 13 #-core-limits the core file size (KB) 14 core-limit the size of the kernel file 15 #-data-max data size (KB) 16 date-max data size 17 #-fsize-maximum filesize (KB) 18 fsize-max file size 19 #-memlock-max locked-in-memory address space (KB) 20 memlock-maximum lock memory address space 21 #-nofile-max number of open files22 nofile-maximum number of opened files 23 #-rss-max resident set size (KB) 24 rss-max persistent setting size 25 #-stack-max stack size (KB) 26 stack-max stack size 27 #-cpu-max CPU time (MIN) 28 cpu-maximum CPU time in minutes 29 #-nproc-max number of processes30 noproc-maximum number of processes 31 #-as-address space limit (KB) 32 as-address space limit 33 #-maxlogins-max number of logins for this user34 maxlogins-the maximum number of logins allowed by this user 35 #-maxsyslogins-max number of logins on the system36 # -priority-the priority to run user process with37 #-locks-max number of file locks the user can hold38 #-sigpending-max number of pending signals39 #-msgqueue-max memory used POSIX message queues (bytes) 40 #-nice-max nice priority allowed to raise to values: [-20, 19] 41 #-rtprio-max realtime priority42 #43 # 44 #45 46 # * soft core 047 # * hard rss 1000048 # @ student hard nproc 2049 # @ faculty soft nproc 2050 # @ faculty hard nproc 5051 # ftp hard nproc 052 # @ student -maxlogins 453 54 # End of file55mysql soft core 204800056 mysql hard core 204800057 mysql soft nofile 81920058 mysql hard nofile 819200 if you encounter a "segment error" (segmentation fault) this problem occurs because the initial stack size of the Linux system is too small. you can use ulimit-s www.2cto.com core-to limit the size of the kernel file. what is 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. Nofile-the maximum number of opened files for applications that require many socket connections and make them open, it is best to use ulimit-n or set the nofile parameter, set the number of file descriptors to a higher value than the default value.
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