/
리눅스 최대 열수 있는 파일 갯수 수정하기(Linux increase the max open files per user)
리눅스 최대 열수 있는 파일 갯수 수정하기(Linux increase the max open files per user)
리눅스 사용자별 오픈 파일 최대 갯수 늘리기
kernel 설정 변경
현재 kernel 설정 값을 proc file system 을 통해 확인
$ cat /proc/sys/fs/file-max 77688
하드 리미트. 소프트 리미트 확인
$ ulimit -Hn 4096 $ ulimit -Sn 1024
먼저 /etc/sysctl.conf 파일을 수정해서 커널 제한 늘리기
fs.file-max = 2097152
커널 설정 반영
$ sudo sysctl -p
사용자별 늘리기
설정 파일 오픈
vi /etc/security/limits.conf
httpd 사용자의 파일 제한 늘리기
httpd soft nofile 524288 httpd hard nofile 524288 nginx soft nofile 524288 nginx hard nofile 524288
저장하고 logoff 한 후에 해당 사용자로 로그인해서 설정 확인
su -c "ulimit -Hn" nginx
위 설정이 반영되지 않을 경우 /etc/pam.d/login 에서 pam_limits.so 를 로딩하는지 확인(참고 man limits.conf)
session required pam_limits.so
또는 /etc/security/limits.d/90-nproc.conf 같은 파일에 하드 코딩되어 있을수도 있음. 아래는 실제 하드 코딩된 사례
# Default limit for number of user's processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * soft nproc 1024 root soft nproc unlimited
Ref
, multiple selections available,
Related content
DB2 express Linux 에 설치하기
DB2 express Linux 에 설치하기
More like this
linux df 명령어 사용법
linux df 명령어 사용법
More like this
Amazon EBS 볼륨 리눅스에 마운트 하기
Amazon EBS 볼륨 리눅스에 마운트 하기
More like this
파일이나 파일 시스템의 상태를 출력하는 linux stat 명령어 사용법
파일이나 파일 시스템의 상태를 출력하는 linux stat 명령어 사용법
More like this
WSL(Windows Subsystem for Linux) 폴더를 Windows depender 예외 폴더 처리하기
WSL(Windows Subsystem for Linux) 폴더를 Windows depender 예외 폴더 처리하기
More like this
noatime 마운트 옵션으로 파일 시스템 성능 향상 시키기
noatime 마운트 옵션으로 파일 시스템 성능 향상 시키기
More like this