응용 프로그램이 "때때로"시간 초과되었습니다. Java 클라이언트가 유닉스 데몬에 연결되어 있고 어떤 이유로 다음과 같은 오류가 발생했습니다 :SocketChannel - java.net.ConnectException : 연결 시간 초과 : 연결
SocketException: Cannot establish connection to daemon
java.net.ConnectException: Connection timed out: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.nio.channels.SocketChannel.open(Unknown Source)
at ....
at java.lang.Thread.run(Unknown Source)
이 스택 트레이스는 다음 코드에서이다 :
는try
{
InetSocketAddress inetAddress = new InetSocketAddress(InetAddress.getByName(serverName), serverPort);
socketChannel = SocketChannel.open(inetAddress); // <--- I think the problem is here
pipeSck = socketChannel.socket();
}
catch (NoRouteToHostException e)//when the remote host cannot be reached or connection was refused
{
System.err.println("NoRouteToHostException: Cannot establish connection to daemon");
e.printStackTrace();
return 1; /* reply only with error */
}
catch (SocketException e)//when the remote host cannot be reached or connection was refused
{
System.err.println("SocketException: Cannot establish connection to daemon");
e.printStackTrace();
return 1; /* reply only with error */
}
이 시간의 99 %를 작동 ... 어떤 아이디어 왜 우리는 시간 제한을 받고?
감사합니다.
내 다른 의견에 따르면, 백 로그는 현재 10으로 설정되어 있으며 약 15 년 동안 유지되었습니다. 우리 고객은 현재 더 많은 사용자를 보유하고 있으므로 마침내 한계에 도달 한 것으로 보입니다. – Samah
@Samah 커널을 엿보는 것보다 실제 값을 알 수있는 방법은 없지만, 플랫폼은 자체 최소값을 가지고 있으며, 적어도 10을 자동으로 적어도 50으로 올립니다. – EJP
Solaris 10을 실행 중입니다. : http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.express.doc/info/exp/ae/tprf_tunesolaris.html 기본 백 로그는 128입니다. 자동으로 증가하는 경우 적어도, 나는 그것이 무엇이 될지 확신하지 못한다. 편집 : 실행이 "1"이라고 말하고 있지만 올바른 매개 변수를보고 있는지 확실하지 않습니다.'ndd -get/dev/tcp tcp_conn_req_min' – Samah