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 ED2E018C0D for ; Fri, 5 Feb 2016 21:49:21 +0000 (UTC) Received: (qmail 35739 invoked by uid 500); 5 Feb 2016 21:49:19 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 35663 invoked by uid 500); 5 Feb 2016 21:49:19 -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 35652 invoked by uid 99); 5 Feb 2016 21:49:19 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2016 21:49:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5B44BC0D97 for ; Fri, 5 Feb 2016 21:49:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.3 X-Spam-Level: X-Spam-Status: No, score=0.3 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Ux0OWvgTbKni for ; Fri, 5 Feb 2016 21:49:18 +0000 (UTC) Received: from vms173025pub.verizon.net (vms173025pub.verizon.net [206.46.173.25]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 3C9B32050D for ; Fri, 5 Feb 2016 21:49:18 +0000 (UTC) Received: from Christophers-iMac.local ([71.127.40.115]) by vms173025.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O23008RPGLK9082@vms173025.mailsrvcs.net> for users@tomcat.apache.org; Fri, 05 Feb 2016 15:48:56 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=EdU1O6SC c=1 sm=1 tr=0 a=tVXBnewmVzifmTgg5+7jYA==:117 a=IkcTkHD0fZMA:10 a=jFJIQSaiL_oA:10 a=-57I09spAAAA:8 a=j4nzMFrpAAAA:8 a=QfKxxUxMAAAA:8 a=n_Lgu8r0vh9Y7sEQHlEA:9 a=QEXdDO2ut3YA:10 Subject: Re: Installing APR based Apache Tomcat Native Library To: Tomcat Users List References: <56B0BA1F.6000103@christopherschultz.net> <56B10CF8.6090602@christopherschultz.net> <56B21698.1040401@christopherschultz.net> <56B26DD5.3020406@christopherschultz.net> From: Christopher Schultz X-Enigmail-Draft-Status: N1110 Message-id: <56B518C7.1010009@christopherschultz.net> Date: Fri, 05 Feb 2016 16:48:55 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yuval, On 2/4/16 3:14 AM, Yuval Schwartz wrote: >> On Wed, Feb 3, 2016 at 11:15 PM, Christopher Schultz < >> chris@christopherschultz.net> wrote: > > ELB usually uses HTTP keepalive, so that might be part of the > issue. > >> ELB has a feature called "connection draining" which keeps >> connections open while the instance is de-registering (my >> instance begins de-registering when I shutdown tomcat) for a set >> period of time (default: 300 s). It is this connection that stays >> open when tomcat shuts down that causes the WARNING message to >> appear. If I disable connection draining then I stop seeing the >> WARNING when I shutdown tomcat. That'll do it. So, if you had waited 5 minutes between removing your node from ELB and shutting-down Tomcat, you'd find that there also no errors. >> However, "connection draining" seems like a nice feature. One >> option to overcome this WARNING while still keeping connection >> draining would be to first undeploy my application, then, after >> the connection draining time period expires, shutdown tomcat >> (tested this, doesn't throw the warning). > >> Do you have any other recommendations for how I might keep this >> feature and adjust something else in my configuration? Any light >> to shed on the matter? Wait 5 minutes? 5 minutes is quite a long time to drain the node. How long is the average request? In production, we use ELB with 30-second draining. (Then again, we have a layer of stateless httpd instances in between... when we drain our Tomcat nodes, we typically wait over an hour.) I think this might come down to the lack of flexibility of ELB. The way we use ELB, we are balancing between a set of httpd instances which are *all* proxying to the same set of back-end Tomcat nodes. So the currently-enabled set of httpd instances is irrelevant to the client: any httpd can get to any Tomcat. When we want to service an httpd instance, we remove it from the ELB with a short draining period and reboot, upgrade, whatever. No interruption to the Tomcat nodes. If we want to service a Tomcat node, we bring-down the node from *httpd*, not from ELB. We are using mod_jk which allows you to put a Tomcat node into a "disabled" state, which means existing users will still be routed to the node that is "going down" but new users will go to other nodes instead. Once the number of sessions on that node goes to zero, we STOP the node in mod_jk (NO TRAFFIC AT ALL to the node) and then service it. ELB lacks this two-phase removal feature that mod_jk has. That means, when you remove a node from ELB, the countdown starts for your users... if they don't log off from that node, they will lose their sessions in T minus 5 minutes. If you are using sticky sessions with no clustering (like we are), then those users are just out of luck when the 5-minute timer runs out. If you want better behavior, you are going to need more complexity. /On the other hand/, if you *are* clustered and don't use (or need) sticky sessions, then you can significantly reduce that user-draining period to the maximum reasonable response time you expect to be able to serve. If you have a super-fast entirely-clustered (or stateless) service, set the drain time to 1 second. If you have requests that routinely last 45 seconds, set the drain-time to more like 90 seconds. 5 minutes doesn't seem like it makes any sense to be in any scenario, though. Hope that helps, - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAla1GMcACgkQ9CaO5/Lv0PBO+ACeJLP4z3DUfcUqVmG30w7sYSsN 5ggAoLDU8DSnA1vjVppiN9QU11GFsfng =RhN2 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org