커피향이 나는 *NIX
커피닉스
시스템/네트웍/보안을 다루는 곳
*
HanIRC의 #coffeenix 방
[
장비 및 회선 후원
]
> Forum <
IT 일정
N
e
w
!
자동화 프로젝트
HOME
>
시스템 관리 / 서버운영
>
서버운영
도움말
검색 :
사이트
WHOIS
웹서버 종류
ulimit 사용법 (글 윤영한)
작성일 : 2003/12/11 01:34
글쓴이 : 좋은진호 (
http://coffeenix.net/
)
조회수 : 18573
[
이전화면
/
수정
] 비밀번호 :
현재는
http://chongnux.klug.or.kr
이 아닌
http://chongnux.ilinuxbay.com/
(청눅스)
_____________________________________________________________________
작성자 : 윤영한 (shee@chongnux.klug.or.kr)
홈페이지 :
http://chongnux.klug.or.kr
_____________________________________________________________________
[ RedHat 7.2 ]
- 한도에는 두가지 종류가 있다, 소프트 한도는 새로운 프로그램이 생성되면 디폴트로
적용되는 한도이다. 하드 한도는 소프트 한도에서 최대 늘릴수 있는 한도 이다.
하드 한도는 슈퍼유저에 의해서만 조정이 가능하지만 무한히 늘릴수 있는 것은
아니다. 만약 고칠려면 커널에서 이 값을 조정해야 한다.
기본 설정은 /etc/profile에서 ulimit가 아닌 다른 방법은 /etc/security/limit.conf
화일을 이용하는 것도 좋은 방법이다.
* 소프트 한도
[root@vm_master etc]# ulimit -Sa
core file size (blocks) 0 # 코어파일의 최대크기
data seg size (kbytes) unlimited # 프로세스의 데이타 세그먼트 최대크기
file size (blocks) unlimited # 쉘에서 생성되는 파일일 최대크기
max locked memory (kbytes) unlimited
max memory size (kbytes) unlimited # resident set size의 최대크기(메모리 최대크
기)
open files 1024 # open file descriptors의 최대 숫자(열수있
는 최대파일수)
# 하나의 프로
세스당 최대 열수 있는 화일의 개수
pipe size (512 bytes) 8 # 512-바이트 블락의 파이프 크기
stack size (kbytes) 8192 # 프로세스의 스택 최대크기
cpu time (seconds) unlimited # 총 누적된 CPU시간(초)
max user processes 1024 # 단일 유저가 사용가능한 프로세스의 최대갯수
# virtual memory (kbytes)
unlimited # 쉘에서 사용가능한 가상 메모리의 최대용량
*하드 한도
[root@vm_master etc]# ulimit -Ha
core file size (blocks) unlimited
data seg size (kbytes) unlimited
file size (blocks) unlimited
max locked memory (kbytes) unlimited
max memory size (kbytes) unlimited
open files 1024
pipe size (512 bytes) 8
stack size (kbytes) unlimited
cpu time (seconds) unlimited
max user processes 1024
virtual memory (kbytes) unlimited
[사용 방법]
ulimit [옵션] 값
-a: 모든 제한 사항을 보여준다.
-c: 최대 코어 파일 사이즈
-d: 프로세스 데이터 세그먼트의 최대 크기
-f: shell에 의해 만들어질 수 있는 파일의 최대 크기
-s: 최대 스택 크기
-p: 파이프 크기
-n: 오픈 파일의 최대수
-u: 프로세스 최대수
-v: 최대 가상메모리의 량
[ ulimit & 커널 소스 헤더 분석 ]
[ /usr/src/linux-2.4.17/include/linux/fs.h ]
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
* nr_file rlimit, so it's safe to set up a ridiculously high absolute
* upper limit on files-per-process.
*
* Some programs (notably those using select()) may have to be
* recompiled to take full advantage of the new limits..
*/
/* Fixed constants first: */
/* 한 프로세스당 화일 수의 절대 한계점
*/
#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */
/* 한 유저가 열 수 있는 최대 화일수
*/
#define INR_OPEN 1024 /* Initial setting for nfile rlimits
*/
/* 시스템에서 동시에 열수 있는 최대 화일수 */
#define NR_FILE 8192 /* this can well be larger on a larger
system */
/* /proc/sys/fs/file_max file-nr 값과 같다.
[root@vm_master fs]# cat file-max
8192
[root@vm_master fs]# cat file-nr
298 50 8192
현재 할당되 화일 핸들수
현재 할당된 화일 핸들중 사용중이 핸들수 최대 사용 할 수 있는 화일 핸들수
[ /usr/src/linux-2.4.17/Documentation/filesystems/proc.txt ]
[ /usr/src/linux-2.4.17/include/linux/limit.h ]
#ifndef _LINUX_LIMITS_H
#define _LINUX_LIMITS_H
#define NR_OPEN 1024 # 한 프로세스당 열수 있는 파일수
#define NGROUPS_MAX 32 /* supplemental group IDs are
available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec
() */
#define CHILD_MAX 999 /* no limit :-) */
#define OPEN_MAX 256 /* # open files a process may have */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue
*/
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4095 /* # chars in a path name */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe
*/
#define RTSIG_MAX 32
#endif
커피닉스 카페 최근 글
[06/16]
[질문]SAN 스위치 브로드케이드 dcx8510-4 장비관련입니다.
[04/22]
Re: 영화속에 컴퓨터 이야기 ~스워드피쉬(2001)
[10/20]
Cross Compiler 깔
[07/14]
SSL АО
[04/26]
Re: 도스화면 원격조종 여부
[04/25]
도스화면 원격조종 여부
[10/30]
Cshell에서 난수 설정
[10/23]
공항철도주식회사 SE 구인 件
[01/26]
Re: wget으로 다른서버에있는 디렉토리를 가져오려고합니다.
[01/25]
wget으로 다른서버에있는 디렉토리를 가져오려고합니다.
[01/11]
특정 안드로이드 WebView 버전에서 SSL 문제 (WebView 버그)
[08/01]
DNS forwarder (전달자) 서버를 통해서 쿼리하면 역방향을 받아오질 못합니다.
[05/16]
(주)후이즈 시스템엔지니어 (경력자) 모집
[02/15]
[AWS] Cloudfront edge 확인하기
[01/20]
Mobile Service/eCommerce 기업에서 Server / Java / PHP 개발자 구인
N
e
w
! 최근에 등록한 페이지
KiCad EDA Suite project (Free/Libre/Open-Source EDA Suite) (CAD)
오픈캐스케이드 캐드 (OpenCASCADE CAD)
QCad for Windows --- GNU GPL (Free Software)
The Hello World Collection
IPMI를 활용한 리눅스 서버관리
DNS 설정 검사
nagiosgraph 설치 방법
Slony-I 설치 방법 (postgresql replication tool)
Qmail기반의 Anti spam 시스템 구축하기
clusterssh
[ 함께하는 사이트 ]
운영진 :
좋은진호(truefeel)
, 야수(yasu), 범냉이, sCag
2003년 8월 4일~