Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E830C78BC for ; Thu, 22 Sep 2011 20:21:28 +0000 (UTC) Received: (qmail 79876 invoked by uid 500); 22 Sep 2011 20:21:25 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 79629 invoked by uid 500); 22 Sep 2011 20:21:25 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 79619 invoked by uid 99); 22 Sep 2011 20:21:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2011 20:21:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2011 20:21:18 +0000 Received: from [192.168.245.129] (p549E0C6C.dip0.t-ipconnect.de [84.158.12.108]) by tor.combios.es (Postfix) with ESMTPA id 2738BDA01EB for ; Thu, 22 Sep 2011 22:20:56 +0200 (CEST) Message-ID: <4E7B9895.1030704@ice-sa.com> Date: Thu, 22 Sep 2011 22:20:37 +0200 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: please help me how i can test that whether tomcat is up and running on References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi. This is all very nicely explained, but maybe irrelevant. As far as I understand, the OP is trying to connect to the "shutdown port" mentioned in the tag, not to a . On that shutdown port, there should not be so many connection requests that they outrun the ability of Tomcat to accept a connection on it. I have a suspicion that the client does not connect to Tomcat though, maybe not even to the Tomcat host. But the OP did not really provide enough information to validate or invalidate that suspicion. Daniel Baktiar wrote: > Hi Vishveswara, > > If you look at the behavior of ServerSocket, or any BSD-like listening > server socket in general, there is something called 'backlog'. > http://download.oracle.com/javase/1.4.2/docs/api/java/net/ServerSocket.html > > In short, backlog is something like a queue, if all your worker thread > occupied, the listening server socket is allowed to hold and queue n number > of connecting socket. Only when the all threads occupied and backlog full > then you will get "connection refused". The connection socket in the backlog > is silently accepted but not served yet. If the connection socket was held > in the backlog for quite some time (e.g. due to existing worker threads > still busy), until it is time out for the connection client socket, then > that what you have said may occur: the Tomcat is up and running, yet the > connection client socket java.net.ConnectException: Connection timeout: > connect. > > So, what you can detect by a connection client socket is not "whether Tomcat > is up and running", instead "whether Tomcat is up and running and able to > accept and process one more client socket within the client time out > interval". There are cases where "Tomcat is up and running" but "is not able > to accept and process one more client socket within the client time out > interval" (which is the case when "java.net.ConnectException: Connection > timeout: connect" happens). > > There is an "acceptCount" attribute in server.xml which > specifies the backlog. If you set this to 0, it may behave the way you want, > but you have to test yourself whether that will be good for the system > behaviour and performance from the user point of view. > > --- > daniel baktiar > > On Thu, Sep 22, 2011 at 18:30, vishveswara chary varanasi < > vvchary.varanasi@gmail.com> wrote: > >> Tomcat community has a wiki which providded the >> >> http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command >> >> i have tried to connect to tomcat using sockect connection on the port >> where the tomcat running >> >> Socket socket = new Socket("hostname", port); >> >> this works some time and some time even if the tomcat is up and >> runnning this is throwing the java.net.ConnectException: Connection >> timed out: connect. >> >> please help me how i can test that whether tomcat is up and running on >> a remote machine from a client machine. >> >> Thanks >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org