ulimit限制 新系统_Linux查看及修改系统的资源限制命令ulimit
在Linux,查看系統對資源使用的顯示可以使用命令ulimit,其中參數-a會列出所有的資源使用限制。[demo@server ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 2055823
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
修改系統的資源對用戶的使用限制
資源對用戶的使用限制在/etc/security/limits.conf文件里配置。如下:demo@server:~$ cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#
#
#Where:
# can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
# can have the two values:
# - "soft" for enforcing the soft limits # 軟限制,必須必硬限制的值要小
# - "hard" for enforcing hard limits # 硬限制
#
# can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files # 最大打開的文件數(以文件描敘符,file descripter計數)
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#
#
#
root soft nofile 200000
root hard nofile 200000
admin hard nofile 65536
admin soft nofile 65536
# End of file
對資源使用限制的配置是針對用戶或者用戶組,每行格式如下:
用戶名/用戶組 類型(硬限制hard、軟限制soft) 選項 值
其中類型的值可以為hard,soft或者“-”,其中“-”相當于同時配置了hard和soft兩行。
注意:退出重新登錄后,配置生效
總結
以上是生活随笔為你收集整理的ulimit限制 新系统_Linux查看及修改系统的资源限制命令ulimit的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机科技新闻,新浪网_科技时代_计算机
- 下一篇: php curl跨域cookie_php