1994.8.24



SUBJECT: Axil-311 에서 하나의 Process 가 최대 file open #

MEANING OF THIS MEMO:
1. 현대증권 의 Axil 311 에서 Communication  Server Process 가 돌고있으면서
LAN 상의 PC 가 증권의 관심종목이나, 현재가를 조회할경우에 Socket
Connection으로 하나의 fd(file descriptors) 를 할당하는데 64개 가 최대.
256 으로 늘이는 방법을 서술함. 

2. fd 가 64 가 되면 error #24 "Too many files open"
3. fd 중에서 0(stdin), 1(stdout), 2(stdout), Application 에서 사용한느것도있어서 단말을 50 대 이상을 물릴수가 없음.
4. HelpDesk 에서 "Too many files open" 찾음.

DESC:  man limit 참조

1. more a.c

#include 
#include 
main()
{
	int  fd;

	fd = open("/tmp/aaa",O_CREAT);
	printf("fd is %d\n", fd);

	fd = open("/tmp/aa0",O_CREAT);
	printf("fd is %d\n", fd);

	fd = open("/tmp/aa1",O_CREAT);
	printf("fd is %d\n", fd);
	...............
	...............

	fd = open("/tmp/a80",O_CREAT);
	printf("fd is %d\n", fd);

}

2. a > a.result

fd is 3
fd is 4
fd is 5
......
......
fd is 59
fd is 60
fd is 61
fd is 62
fd is 63
fd is -1
fd is -1  <-----Error 24:Too many files open
.....
.....
fd is -1
fd is -1
fd is -1
fd is -1

3. vi /.cshrc
...
limit descriptors 256
...
4. a > a.result2


fd is 3
fd is 4
fd is 5
...
....
fd is 62
fd is 63
fd is 64
fd is 65
fd is 66
fd is 67
fd is 68
fd is 69
fd is 70
fd is 71
fd is 72
fd is 73
fd is 74
fd is 75
fd is 76
fd is 77
fd is 78
fd is 79
fd is 80
fd is 81
fd is 82
fd is 83
fd is 84

4.결론.
csh 에서는 application 이 file open 을 수행할때 시스템에서 제한을 할수가있다.
Default 는 soft-limit 의 descriptors 가 64 이고 hard-limit(-h option) 은 256.

ex)
atom# limit
cputime         unlimited
filesize        unlimited
datasize        unlimited
stacksize       8192 kbytes
coredumpsize    unlimited
memoryuse       unlimited
descriptors     64 

atom# limit -h
cputime         unlimited
filesize        unlimited
datasize        unlimited
stacksize       unlimited
coredumpsize    unlimited
memoryuse       unlimited
descriptors     256 

******************************************
* .cshrc 에 limit descriptos 256 으로 함 *
******************************************

atom# limit
cputime         unlimited
filesize        unlimited
datasize        unlimited
stacksize       unlimited
coredumpsize    unlimited
memoryuse       unlimited
descriptors     256 

    
Revision History
Created             on Dec  24 ,1994