# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> 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
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
# End of file
상세설명은 아래와 같습니다.
- domain : 제한할 대상작성 (*, user명, 그룹명을 줄 수 있다.(그룹에 적용할 경우 @가 붙는다))
- type : 강하게 제한할 것인지, 어느정도 여유를 줄 것인지를 결정한다.
- soft : soft로 설정한 용량을 넘어가면 '경고' 메시지를 남깁니다..
- hard : 어떠한 일이 있어도 hard를 넘을 수 없다는 의미이다.
- item : 제한할 항목으로 core, data seg, file size등 여러가지가 존재.
- nproc : 최대 프로세스의 갯수(KB)
- stack : 최대 스택 사이즈(KB)
- nofile : 한번에 열 수 있는 최대 파일 수
- core : core파일의 사이즈(KB)
- value : 제한 하고자 하는 설정값
예제
--> 아래는 예제일뿐, 관리하시는 DB서버에 스펙에 따라 value를 적절히 조정하셔야 합니다.
cubrid hard nproc 83728 cubrid soft nproc 83728 cubrid soft stack 10240 cubrid soft nofile 55536 cubrid hard nofile 55536 cubrid soft core 102400000
위 설정을 관리하는 서버에 적절히 이용하시면 효과적인 서버 관리를 할 수 있겠습니다.
현재 서버에서 제한사항 보기
[root@os1 ~]# 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) 8191
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 8191
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
감사합니다.