| Too many open files 에러발생시 | 작성일 : 2006/07/11 14:51 |
| 조회수 : 33126 |
|
제 목 : Too many open files 에러발생시 작성자 : 좋은진호(truefeel, http://coffeenix.net/ ) 작성일 : 2006.7.10(월) 자바에서 다음과 같은 에러가 발생했다면 FD(File Descriptor)를 늘려줘야 한다.
1. open files 최대 개수 확인 먼저 ulimit -a 으로 open files 개수를 확인한다. ulimit -aH는 hard limit, -aS는 sort limit를 확인. csh 쉘을 사용하면 limit 명령으로 살펴볼 수 있다.
2. 프로세스별로 오픈된 파일 개수 확인 열린 파일 lsof 명령으로 확인할 수 있다. 지정한 프로세스가 몇개의 파일을 사용중인지를 확인할 때는 다음처럼 실행 하면 알 수 있다. lsof -p PID | wc -l 1234, 1236 PID 2개에 대해 살펴본다면 콤마(,)로 PID를 구분해서 적어주면 된다.
3. 파일개수 늘리기 리눅스환경을 기준으로 설명한다. truefeel 사용자의 open files개수를 4096(sort limit), 6144(hard limit) 로 제한한다면 /etc/security/limits.conf에 다음 줄을 추가해주면 로긴시 적용된다.
4. 참고 자료 * Too Many Open Files Exception http://kr.bea.com/files/services/customer_support/best_tip/06_200406/06_2_14.pdf * Too many open files http://kr.bea.com/services/customer_support/SupportPattern/08_15_Too_Many_Open_Files_Pattern.html |
|||||||||||||
|
|