Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 41291 invoked from network); 28 Oct 2009 18:38:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Oct 2009 18:38:33 -0000 Received: (qmail 60562 invoked by uid 500); 28 Oct 2009 18:38:30 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 60489 invoked by uid 500); 28 Oct 2009 18:38:29 -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 60478 invoked by uid 99); 28 Oct 2009 18:38:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 18:38:29 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 18:38:21 +0000 Received: from [192.168.2.100] ([192.168.2.100]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id n9SIbxJ7016453 for ; Wed, 28 Oct 2009 19:38:00 +0100 (CET) Message-ID: <4AE88F87.20608@kippdata.de> Date: Wed, 28 Oct 2009 19:37:59 +0100 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: So many timeout values References: <2dfefcd20910250912n7d54b5c4w80f921eeb02578a8@mail.gmail.com> <4AE5BDFA.4080402@christopherschultz.net> <4AE5CC82.8070506@kippdata.de> <2dfefcd20910261054s4b49707ax2e700f7b8e40d8c6@mail.gmail.com> <2dfefcd20910261540n696683b0qbdf1abb65c0587ad@mail.gmail.com> <4AE751A0.5010209@christopherschultz.net> <2dfefcd20910280929w12301380ubbc9df7cc7d765a8@mail.gmail.com> <4AE885A0.1060508@kippdata.de> <2dfefcd20910281129u2b6dd677w978263f950d57ae6@mail.gmail.com> In-Reply-To: <2dfefcd20910281129u2b6dd677w978263f950d57ae6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 28.10.2009 19:29, Mohit Anchlia wrote: > Thanks a lot! > > Would this work with 1.2.27? Remove the escalation parameter, I guess that's the only 1.2.28 special param. > Regarding recovery_options: Is there a default value it's set to? On > the link http://tomcat.apache.org/connectors-doc/reference/workers.html > it doesn't have option "7" Yes, the default is "0" and that's bad. > Regarding ping_mode: > What happens when Cping returns error for ping_mode "C"? Does it send > that user request that's using that connection to other lb node? Yes after retries, because if not CPong is received the node is ery likely broken. > Wouldn't using "Pre Post" be the best thing to do? Both. Connect cping is done after the initial connection setup, prepost cping is done directly before each followup request (2nd, 3rd, ...). > On Wed, Oct 28, 2009 at 10:55 AM, Rainer Jung wrote: >> On 28.10.2009 17:29, Mohit Anchlia wrote: >>> Based on what I have seen is that we often get HTTP code 502 and by >>> increasing socket timeout those errors disappear. I am not sure why >>> that happens. >>> >>> Based on the feedback I got it looks like the below properties file is >>> ok except the socket timeout piece and I should probably remove that? >> >> Yes. See below. >> >>> Here is workers.properties file: >>> ## >>> worker.list=status,tc >>> >>> ## Worker Configuration## >>> >>> # All entries in this section take the form: >>> # worker..= >>> # Worker names are defined in the worker.list directive above. >>> >>> >>> # Configuration specifying the worker named "status" as a status worker. >>> # This worker can be used to administer the other configured workers. >>> worker.status.type=status >>> >>> >>> # Configuration for the default load balancer worker. >>> # Uncomment the configuration for the "tc" >>> # worker, and the two "node" workers below to enable. >>> # Also add "lb" to the workers.list directive >>> # above. The default for the load balancer worker is >>> # round-robin distribution of requests over >>> # all active nodes. There are currently two nodes set >>> # up for the load balanced worker, add more >>> # to this list if required. Sticky sessions is defaulted to true. >>> worker.tc.type=lb >>> worker.tc.balance_workers=appfe1,appfe2,appfe3,appfe4 >>> >>> worker.tc.sticky_session=true >> >> That's default, but setting it does not harm. >> >>> # Two load balanced workers, called node1 and node2. >>> # Copy the configurations and add to the >>> # worker.tc.balanced_workers >>> # list above to add more nodes to the Tomcat cluster. >> >> Think about using a template, which makes config management easier: >> >> # template >> worker.template.type=ajp13 >> worker.template.port=8009 >> worker.template.socket_timeout=5 >> worker.template.socket_keepalive=true >> worker.template.prepost_timeout=5 >> worker.template.connect_timeout=5000 >> worker.template.retries=3 >> worker.template.recycle_timeout=900 >> >> then >> >> worker.appfe1.reference=worker.template >> worker.appfe1.host=appfe1 >> >> worker.appfe2.reference=worker.template >> worker.appfe2.host=appfe2 >> >> ... >> >> Concerning the following config: prepost timeout is in milliseconds. 5 >> is way to short. >> >>> # appfe1 >>> worker.appfe1.type=ajp13 >>> worker.appfe1.port=8009 >>> worker.appfe1.host=appfe1 >>> worker.appfe1.socket_timeout=5 >>> worker.appfe1.socket_keepalive=true >>> worker.appfe1.prepost_timeout=5 >>> worker.appfe1.connect_timeout=5000 >>> worker.appfe1.retries=3 >>> worker.appfe1.recycle_timeout=900 >>> >>> # Refererence BHP Apache tuning guide before uncomment the following >>> line. The unit of reply_timeout is millisecond. >>> #worker.appfe1.reply_timeout=0 >>> >>> # appfe2 >>> worker.appfe2.type=ajp13 >>> worker.appfe2.port=8009 >>> worker.appfe2.host=appfe2 >>> worker.appfe2.socket_timeout=5 >>> worker.appfe2.socket_keepalive=true >>> worker.appfe2.prepost_timeout=5 >>> worker.appfe2.connect_timeout=5000 >>> worker.appfe2.retries=3 >>> worker.appfe2.recycle_timeout=900 >>> >>> # Refererence BHP Apache tuning guide before uncomment the following >>> line. The unit of reply_timeout is millisecond. >>> #worker.appfe2.reply_timeout=0 >>> >>> # appfe3 >>> worker.appfe3.type=ajp13 >>> worker.appfe3.port=8009 >>> worker.appfe3.host=appfe3 >>> worker.appfe3.socket_timeout=5 >>> worker.appfe3.socket_keepalive=true >>> worker.appfe3.prepost_timeout=5 >>> worker.appfe3.connect_timeout=5000 >>> worker.appfe3.retries=3 >>> worker.appfe3.recycle_timeout=900 >>> >>> # Refererence BHP Apache tuning guide before uncomment the following >>> line. The unit of reply_timeout is millisecond. >>> #worker.appfe3.reply_timeout=0 >>> >>> # appfe4 >>> worker.appfe4.type=ajp13 >>> worker.appfe4.port=8009 >>> worker.appfe4.host=appfe4 >>> worker.appfe4.socket_timeout=5 >>> worker.appfe4.socket_keepalive=true >>> worker.appfe4.prepost_timeout=5 >>> worker.appfe4.connect_timeout=5000 >>> worker.appfe4.retries=3 >>> worker.appfe4.recycle_timeout=900 >> >> Now w.r.t. the params, I would slightly change (assuming version 1.2.28): >> >> # template >> worker.template.type=ajp13 >> worker.template.port=8009 >> # Only use it if you find a good reason for it :) >> # worker.template.socket_timeout=5 >> worker.template.socket_connect_timeout=10000 >> worker.template.socket_keepalive=true >> worker.template.ping_mode=A >> worker.template.ping_timeout=10000 >> worker.template.connection_pool_minsize=0 >> worker.template.connection_pool_timeout=900 >> worker.template.retries=3 >> worker.template.recovery_options=7 >> >> # Refererence BHP Apache tuning guide before uncomment the >> # following line. The unit of reply_timeout is millisecond. >> # Then also set worker.lb.max_reply_timeouts=10 >> #worker.template.reply_timeout=60000 >> >> I would also recommend >> >> worker.lb.error_escalation_time=0 >> >> but opinions about this vary. >> >> Note that you need to check, whether your Java Memory and Garbage >> Collection configuration is fine. Otherwise in case of using large >> memory the backend might experience long GC pauses triggering some of >> the above timeouts. >> >> Note that connection_pool_timeout (the same as recycle_timeout but not >> deprecated) should be set to the same time interval than connectTimeout >> in Connector of server.xml. But in server.xml you must use milliseconds, >> in workers.properties the attribute is in seconds. >> >> Regards, >> >> Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org