Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 38086 invoked from network); 8 Jan 2010 21:49:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jan 2010 21:49:14 -0000 Received: (qmail 21037 invoked by uid 500); 8 Jan 2010 21:49:10 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 20953 invoked by uid 500); 8 Jan 2010 21:49:10 -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 20942 invoked by uid 99); 8 Jan 2010 21:49:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 21:49:10 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.80] (HELO qmta08.westchester.pa.mail.comcast.net) (76.96.62.80) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 21:48:59 +0000 Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta08.westchester.pa.mail.comcast.net with comcast id T3mT1d0051wpRvQ589ofp0; Fri, 08 Jan 2010 21:48:39 +0000 Received: from [192.168.1.202] ([98.218.200.175]) by omta18.westchester.pa.mail.comcast.net with comcast id T9og1d0083nZbXm3e9og5X; Fri, 08 Jan 2010 21:48:41 +0000 Message-ID: <4B47A834.2070401@christopherschultz.net> Date: Fri, 08 Jan 2010 16:48:36 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: limit number of connections tomcat accepts References: <201001060903.57300.pbeichert@web.de> <4B44951A.4010902@christopherschultz.net> <201001080902.48923.pbeichert@web.de> In-Reply-To: <201001080902.48923.pbeichert@web.de> X-Enigmail-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter, On 1/8/2010 3:02 AM, Peter Beichert wrote: > Thank you for your help. The good new is, that Tomcat really works like it > supposed to. The problem is, that the operating system holds all the > connections which did not receive an acknowledgement from the server. This is what "acceptCount" is supposed to configure. Is that not working for you? What JVM are you using? > When monitoring the tcp-connections during the tests with netstat, I could > see, that the number of established connections was the sum of threads plus > the number of queued requests. All other connections could be observed at the > server with a SYN_RECV state. As soon as tomcat finished one request, a new > connection was acknowledged and the number of connections with the SYN_RECV > state decreased by one. > > The value of the maximum remembered connection requests in Linux is the Kernel > parameter tcp_max_syn_backlog which is by default 1024. It can be reduced with > the /sbin/sysctl command. Good to know, though I would have expected acceptCount to work properly. My understanding of acceptCount is that the socket listener will receive at most maxActive concurrent requests. After that, acceptCount incoming requests will be queued in the TCP/IP stack, and subsequent requests will get a connection refused. If the client has a timeout and/or retry configured, then that will confuse the issue but the initial connection should be refused. Once a request has been completed and the socket is closed, the queue is processed and another incoming request is free to be queued by the TCP/IP stack. I'm curious as to exactly how your observations stack up against that: are you saying that, in spite of your acceptCount="5", you're effectively getting acceptCount="1024" because of how your kernel behaves? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktHqDQACgkQ9CaO5/Lv0PCM5QCgjkVT7rZYAS6Z50sGlqLGAqkx hp0An3jV9aklDaTm8or65Gwyot8Xc5Gb =PC+9 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org