류짱:Beyond MySelf

MaxUserport 본문

Microsoft/Windows Platform

MaxUserport

リュちゃん 2011. 5. 3. 15:48

MaxUserport 값은 동시 연결 사용자가 많아서 포트 부족이 발생 때만 늘리는 것이 권장사항 입니다.

Port full 되지 않는 환경에서 늘려줄 필요는 없는 입니다.

통상적으로 10000 으로 설정을 하게 되면 9000 개의 실제 Outbound 네트워크 연결이 가능 하다고 알려져 있습니다.

 

MaxUserPort 값 늘리기
1.  레지스트리 편집기를 시작합니다.
2.  레지스트리에서 다음 하위 키를 찾은 다음 Parameters를 누릅니다. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
3.  편집 메뉴에서 새 값을 누르고 다음 레지스트리 항목을 추가합니다.

값 이름 : MaxUserPort
값 종류
: DWORD
값 데이터
: 65534
유효 범위: 5000-65534(십진수
)
기본값: 0x1388(십진수
5000)
설명: 이 매개 변수는 프로그램이 시스템에서 사용 가능한 사용자 포트를 요청할 때 사용되는 최대 포트 번호를 제어합니다. 일반적으로 수명이 짧은 임시(ephemeral) 포트에는 1024에서 5000 사이의 값이 할당됩니다.

4.  레지스트리 편집기를 종료합니다.
5.  시스템을 재부팅 합니다.

참고로 Windows Server 2008의 Default Dynamic port range는 49152 - 65535입니다.

The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008
http://support.microsoft.com/kb/929851/en-us

TcpTimedWaitDelay 값 줄이기

1.TcpTimedWaitDelay 값은 TCP/IP가 닫힌 연결을 해제하여 자원을 다시 사용하기 전에 경과되어야 하는 시간입니다.
해당시간을 줄여서 확인합니다.(기본값은 4분입니다.)

2. 시작 -> 실행 -> regedit

3. 아래 경로로 이동합니다.

HKEY_LOCAL_MACHINE\SYSTEM\currentControlSet\services\tcpip\parameters

4. TcpTimedWaitDelay이 있다면 설정내용 확인, 없다면 아래와 같이 추가합니다.

    TYPE : DWORD

NAME: TcpTimedWaitDelay

 VALUE: 30

6.  시스템 재부팅합니다.

 

 

[참고자료]

http://technet.microsoft.com/en-us/library/bb726981.aspx

http://technet.microsoft.com/ko-kr/library/aa995661(EXCHG.80).aspx

 

When a TCP connection is closed, the socket-pair is placed into a state known as TIME-WAIT. This is done so that a new connection does not use the same protocol, source IP address, destination IP address, source port, and destination port until enough time has passed to ensure that any segments that may have been misrouted or delayed are not delivered unexpectedly. The length of time that the socket-pair should not be reused is specified by RFC 793 as 2 MSL (two maximum segment lifetimes), or four minutes. This is the default setting for Windows NT and Windows 2000. However, with this default setting, some network applications that perform many outbound connections in a short time may use up all available ports before the ports can be recycled.

Windows NT and Windows 2000 offer two methods of controlling this behavior. First, the TcpTimedWaitDelay registry parameter can be used to alter this value. Windows NT and Windows 2000 allow it to be set as low as 30 seconds, which should not cause problems in most environments. Second, the number of user-accessible ephemeral ports that can be used to source outbound connections is configurable using the MaxUserPorts registry parameter. By default, when an application requests any socket from the system to use for an outbound call, a port between the values of 1024 and 5000 is supplied. The MaxUserPorts parameter can be used to set the value of the uppermost port that the administrator chooses to allow for outbound connections. For instance, setting this value to 10,000 (decimal) would make approximately 9000 user ports available for outbound connections. For more details on this concept, see RFC 793. See also the MaxFreeTcbs and MaxHashTableSize registry parameters.