Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1F2F3542 for ; Wed, 4 May 2011 11:05:15 +0000 (UTC) Received: (qmail 82960 invoked by uid 500); 4 May 2011 11:05:14 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 82881 invoked by uid 500); 4 May 2011 11:05:14 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 82872 invoked by uid 99); 4 May 2011 11:05:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 11:05:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vx0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 11:05:08 +0000 Received: by vxb37 with SMTP id 37so1523211vxb.18 for ; Wed, 04 May 2011 04:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=blUbzuCrpXBeGGa0LSqL4tK0fxDlClCNVQJBwhCHM9Q=; b=ADb5yIWGgXmGBK6E5BqqVwAKyblofzYP+zAZDsOp2/DNcLn2OWDyqXm3T6CXygXCLS jyNZke2kAVH3PHycgOh6ClRQzT8yCWJQJqpcRWUZyr74fp7SrHjs+ckr7yzUudLtjV6v w+5AftDSZyXtr5FZLySMTSJmBIw7vi1sGCjCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EpVLQYpob37fyEsf8YGxDdt9QR0VCFS5/bv1VBkWqzR4yY4DamBHnvzwfud0ITQ5f3 w4BGCI7qYD0976g3SujXLuzeWgtg6bmOkMHOV1o0RH05qVPIS0C/s2kLwkpVp8LiFByg aIL21cKaQu3a4BPW3RDkGA9/WaWj18td1Rhk8= MIME-Version: 1.0 Received: by 10.52.177.231 with SMTP id ct7mr1194379vdc.110.1304507087316; Wed, 04 May 2011 04:04:47 -0700 (PDT) Received: by 10.52.159.228 with HTTP; Wed, 4 May 2011 04:04:47 -0700 (PDT) In-Reply-To: <4DC05F39.2060102@apache.org> References: <4DC05F39.2060102@apache.org> Date: Wed, 4 May 2011 15:04:47 +0400 Message-ID: Subject: Re: BIO performance issues From: Konstantin Kolinko To: Tomcat Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2011/5/4 Mark Thomas : > Time: 2s > Activity: Group B clients connect and are added to the queue > =A0 =A0 =A0 =A0 =A0100 threads are allocated to process the B connections > =A0 =A0 =A0 =A0 =A0The B connections are processed and returned to the qu= eue > =A0 =A0 =A0 =A0 =A0100 threads are allocated to process the B connections > Queue: None > Threads: A, B > Group A: Allocated threads. In HTTP keep-alive for 1s > Group B: Allocated threads. In HTTP keep-alive for 0s > Group C: Inactive > Group D: Inactive > Group E: Inactive > Group F: Inactive > Group G: Inactive > Group H: Inactive > Group I: Inactive > Group J: Inactive > > Time: 6s > Activity: Group F clients connect and are added to the queue > =A0 =A0 =A0 =A0 =A0A connections send requests > =A0 =A0 =A0 =A0 =A0A connections are processed and returned to the queue > =A0 =A0 =A0 =A0 =A0C connections are processed and returned to the queue > =A0 =A0 =A0 =A0 =A0D connections are processed and returned to the queue > =A0 =A0 =A0 =A0 =A0E connections are processed and returned to the queue > =A0 =A0 =A0 =A0 =A0F connections are processed and returned to the queue > =A0 =A0 =A0 =A0 =A0A connections are allocated threads but are in keep-al= ive > Queue: C, D, E, F > Threads: A, B > Group A: Allocated threads. In HTTP keep-alive for 0s > Group B: Allocated threads. In HTTP keep-alive for 4s > Group C: Queued. In HTTP keep-alive for 0s > Group D: Queued. In HTTP keep-alive for 0s > Group E: Queued. In HTTP keep-alive for 0s > Group F: Queued. In HTTP keep-alive for 0s > Group G: Inactive > Group H: Inactive > Group I: Inactive > Group J: Inactive I do not quite get what happens in 6s. My first understanding from reading the scenario was that the threads at 2s are busy because we need them to process keep-alive connections. Then I see that at 6s keep-alive connections are in the Queue. What prevents those connections that exist at "2s" from being placed in the Queue? What is "simulated polling" that you tried to implement? Was it trying to read data from each of keep-alive sockets in turn with a short timeout? Where increased CPU usage comes from? > The proposed changes are: > a) restore disabling keep-alive when threads used >=3D 75% of maxThreads Anyway, if the problem persists, I'll be +1 for a), as it should prevent us from falling in this state. +0 for b)..e), as I do not quite get them. An alternative could be to change the default value of maxConnections and calculate it from maxThreads. I wonder, maybe it is time to use the NIO connector as the default one in Tomcat 7. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org