LINUX最大线程数及最大进程数

查看最大线程数:

cat /proc/sys/kernel/threads-max

ulimitUser limits – limit the use of system-wide resources.Syntaxulimit [-acdfHlmnpsStuv] [limit]Options-S Change and report the soft limit associated with a resource.-H Change and report the hard limit associated with a resource.-a All current limits are reported.-c The maximum size of core files created.-d The maximum size of a process’s data segment.-f The maximum size of files created by the shell(default option)-l The maximum size that may be locked into memory.-m The maximum resident set size.-n The maximum number of open file descriptors.-p The pipe buffer size.-s The maximum stack size.-t The maximum amount of cpu time in seconds.-u The maximum number of processes available to a single user.-v The maximum amount of virtual memory available to the process.ulimit provides control over the resources available to the shell and to processes started by it, on systems that allow such control.If limit is given, it is the new value of the specified resource. Otherwise, the current value of the soft limit for the specified resource is printed, unless the `-H’ option is supplied.When setting new limits, if neither `-H’ nor `-S’ is supplied, both the hard and soft limits are set.Values are in 1024-byte increments, except for `-t’, which is in seconds, `-p’, which is in units of 512-byte blocks, and `-n’ and `-u’, which are unscaled values.The return status is zero unless an invalid option is supplied, a non-numeric argument other than unlimited is supplied as a limit, or an error occurs while setting a new limit.ulimit is a bash built in command.

Ulimit命令设置限制 可以把命令加到profile文件里,也可以在/etc/security/limits.conf文件中定义限制。命令参数-a 显示所有限制-c core文件大小的上限-d 进程数据段大小的上限-fshell所能创建的文件大小的上限-m 驻留内存大小的上限-s 堆栈大小的上限-t 每秒可占用的CPU时间上限-p 管道大小-n 打开文件数的上限-u 进程数的上限-v 虚拟内存的上限除可用Ulimit命令设置外,也可以在/etc/security/limits.conf文件中定义限制。domino type item valuedomino是以符号@开头的用户名或组名,,*表示所有用户,type设置为hard or soft。item指定想限制的资源。如cpu,core nproc or maxlogins。value是相应的限制值。

系统限制默认值

[root@flyinweb ~]# ulimit -acore file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 32764max locked memory (kbytes, -l) 32max memory size (kbytes, -m) unlimitedopen files (-n) 1024pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 10240cpu time (seconds, -t) unlimitedmax user processes (-u) 32764virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited有事者,事竟成;破釜沉舟,百二秦关终归楚;苦心人,

LINUX最大线程数及最大进程数

相关文章:

你感兴趣的文章:

标签云: