검색결과 리스트
글
!markdown
# Linux (리눅스)
### Setup Limit Memory per Process (프로세스 할당 메모리 설정)
#### 1. 현재 계정의 모든 설정 확인
```bash
ulimit -a
```
#### 2. 현재 계정의 메모리확인
```bash
ulimit -m
```
#### 3. 현재 계정의 Process당 최대 할당 가능 메모리 설정 (KB단위)
```bash
ulimit -m 1000
```
`Error`
```bash
ulimit: max memory size: cannot modify limit: Operation not permitted
```
`Solved`
root계정으로 `/etc/security/limits.conf`에 설정하면 설정가능 최대치를 늘릴 수 있다.
```bash
userName hard as 4000000
```
Or AllUser
```bash
* hard as 4000000
```
### Setup Limit Memory per User (사용자 할당 메모리 설정)
#### 1. Edit CGroups `/etc/cgconfig.conf`
```bash
group memlimit {
memory {
memory.limit_in_bytes =
}
}
```
#### 2. Edit `/etc/cgrules.conf`
```bash
userName memory memlimit/
```
Or AllUser
```bash
* memory memlimit/
```
### 참고
How to create a user with limited RAM usage?:
[https://unix.stackexchange.com/questions/34334/how-to-create-a-user-with-limited-ram-usage](https://unix.stackexchange.com/questions/34334/how-to-create-a-user-with-limited-ram-usage)
'OS > Linux' 카테고리의 다른 글
[Linux] rdate, 시간 맞추기(인터넷 동기화) (0) | 2017.04.25 |
---|---|
[find] 파일 찾기 (검색) (0) | 2016.12.03 |
[grep] 파일 내용 검색 (0) | 2016.12.01 |
[Linux] Create USB Installer (설치 USB 만들기) (0) | 2016.07.12 |
SSH 접속하기 (2) | 2016.06.14 |