4,563,353 th visitor since 2017.2.1 ( Today : 247 )
Programming
No. 716
Name. swindler
Subject. java.io.IOException: Too many open files
Main Cate. Java
Sub Cate.
Date. 2013-09-26 16:51
Hit. 5410 (211.36.27.3)
File.
java.io.IOException: Too many open files

리눅스 계열에서
한 프로세스에서 최대로 열수 있는 파일 갯수 제한이 존재한다.

ulimit -a 를 하면
open files에 표기가 되어 있다.

보통 1024

이걸 늘리는 방법은 ulimit 명령어를 사용하는 방법이 있고,
/etc/security/limits.conf 파일을 수정해도 된다.



* soft nofile 8192
* hard nofile 8192


ulimit 으로 바꾸는 경우에는 재부팅시 값이 변경되지 않는다.

참고로 값을 변경하면 로그아웃/로그인을 새로 해야 적용된다.

[바로가기 링크] : http://coolx.net/cboard/develop/716



swindler ls -l /proc/pid/fd 를 하면 해당 프로세스에서 열린 파일 목록을 볼 수 있다. 2013-09-26
swindler 리눅스에서 열수 있는 전체 파일 갯수는 /proc/sys/fs/file-max 설정함 2013-09-26
swindler 8192대신 unlimited 와 같이 잘못된 값을 사용하면 로그인 자체가 안 될수 있다. 적정 최대값이 얼마인지는 모르겠음. 2013-09-26
swindler hard값은 ulimit -Ha 를 해야 조회됨 2013-09-26
swindler lsof | wc -l 실제 열린 파일갯수를 알 수 있다. 2014-07-15
Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog