免费A级毛片无码专区网站-成人国产精品视频一区二区-啊 日出水了 用力乖乖在线-国产黑色丝袜在线观看下-天天操美女夜夜操美女-日韩网站在线观看中文字幕-AV高清hd片XXX国产-亚洲av中文字字幕乱码综合-搬开女人下面使劲插视频

centos7系統(tǒng)資源限制整理

概述在linux系統(tǒng)使用過(guò)程中,默認(rèn)的系統(tǒng)設(shè)置足夠使用,但是對(duì)于一些高并發(fā)高性能的程序會(huì)有瓶頸存在,這些限制主要通過(guò)ulimit查看和修改 。
環(huán)境centos:CentOS  release 7.0 (Final)或以上版本
ulimit查看通過(guò)命令查看當(dāng)前賬戶的限定設(shè)置 。
ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) unlimited
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 65536
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
其中,比較常用的幾個(gè)是 。
“core file size”(coredump記錄文件大小,默認(rèn)為0不記錄) 。
“open files”(進(jìn)程打開(kāi)文件最大數(shù)量,默認(rèn)1024,網(wǎng)絡(luò)連接較多時(shí)會(huì)存在瓶頸) 。
“max user processes”(用戶最大進(jìn)程數(shù),多進(jìn)程程序修改) 。
設(shè)定ulimit資源設(shè)定的修改分硬限制和軟限制,軟限制無(wú)法超過(guò)硬限制的上限,硬限制設(shè)定需要修改系統(tǒng)配置文件 。
格式和說(shuō)明都在配置文件中有清晰的描述 。
vi /etc/security/limits.conf
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a 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
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> 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 file descriptors

經(jīng)驗(yàn)總結(jié)擴(kuò)展閱讀