幸福伝説

[오류]No buffer space available (maximum connections reached?): connect 본문

DB/기타

[오류]No buffer space available (maximum connections reached?): connect

행복전설 2014. 7. 14. 16:36

[오류]

com.microsoft.sqlserver.jdbc.SQLServerException: 호스트 10.250.34.163, 포트 1433에 대한 TCP/IP 연결에 실패했습니다. 오류: "No buffer space available (maximum connections reached?): connect. 연결 속성을 확인하고 SQL Server의 인스턴스가 호스트에서 실행되고 있고 포트에서 TCP/IP 연결을 허용하고 있는지 확인하십시오. 또한 포트에서 TCP 연결을 차단하고 있는 방화벽이 없는지 확인하십시오.".
 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1033)
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
 at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at com.cci.gss.server.Context$Root.<init>(Context.java:202)
 at com.cci.gss.server.request.ConnectGSS.run(ConnectGSS.java:76)
 at com.cci.gss.server.GSSRequest.execute(GSSRequest.java:29)
 at com.cci.gss.server.ThreadPool$GSSThread.run(ThreadPool.java:33)

 

 

[해결]

Resolution for “No buffer space available (maximum connections reached?): JVM_Bind” issue

I hit this issue recently which occurred on only one windows 7 host. The error was caused by this hard to guess reason (http://support.microsoft.com/kb/196271). The default number of ephemeral TCP ports is 5000. Sometimes this number may become less if the server has too many active client connections due to which the ephemeral TCP ports are all used up and in this case no more can be allocated to a new client connection request resulting in the below issue (for a Java application):
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
    at java.net.Socket.bind(Socket.java:577)
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.bind(BaseSSLSocketImpl.java:95)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.bind(SSLSocketImpl.java:45)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:399)
    at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:123)
    at org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory.createSocket(EasySSLProtocolSocketFactory.java:183)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
 



The resolution is to open the registry editor and locate the registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters and add a new entry as shown below:

Value Name: MaxUserPort
Value Type: DWORD
Value data: 65534
That’s it! Thanks to Daniel Baktiar for his post.

Update 6/14/2012:
Microsoft has a hot fix to resolve this issue for Win2K8 R2 and Win7: http://support.microsoft.com/kb/2577795

 

[출처]

http://blog.naver.com/PostView.nhn?blogId=jaymz96&logNo=40177593542

http://rwatsh.blogspot.kr/2012/04/resolution-for-no-buffer-space.html

http://www.databaseskill.com/707652/