Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 85447 invoked from network); 9 Jan 2008 16:46:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2008 16:46:15 -0000 Received: (qmail 13138 invoked by uid 500); 9 Jan 2008 16:45:52 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 13114 invoked by uid 500); 9 Jan 2008 16:45:52 -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 13103 invoked by uid 99); 9 Jan 2008 16:45:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2008 08:45:51 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [69.147.64.88] (HELO smtp115.sbc.mail.sp1.yahoo.com) (69.147.64.88) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 09 Jan 2008 16:45:26 +0000 Received: (qmail 62396 invoked from network); 9 Jan 2008 16:45:30 -0000 Received: from unknown (HELO ?172.16.0.171?) (gabriel_wong@sbcglobal.net@71.129.145.165 with plain) by smtp115.sbc.mail.sp1.yahoo.com with SMTP; 9 Jan 2008 16:45:29 -0000 X-YMail-OSG: gDFP0AYVM1mEXEVrDpaBvVqfnVeCCex6EoTX76q_k.wKI3D828h7Y_onD7JaEWU_SfOW3RKFAM0J2m0ZX.mQytWagAC25Q_DSOqtG8kVylO44aWrGw-- Message-ID: <4784FA28.1080402@ngasi.com> Date: Wed, 09 Jan 2008 08:45:28 -0800 From: Gabe Wong User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: tomcat5.5, balancer References: <4782A9EF.3000408@cbnco.com> <4782BCB4.9040900@kippdata.de> <4784EA99.1010500@cbnco.com> In-Reply-To: <4784EA99.1010500@cbnco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Julio, Double check your httpd.conf to make sure there isn't multiple MaxClients entries that way you are certain the one being used us indeed the entry included in the snippet you had shared with us. Apache does not throw an error for Duplicate MaxClients entries. Julio Cesar Leiva wrote: > Hi all > > > When we introduce load balancing and a 2nd tomcat worker, the time > to service client requests is not balanced. Some clients are serviced > as above, > but others may take 10, 20, 30 seconds or more. Eventually, clients > timeout > and sessions are lost. > > We ran our test over night with just 20 clients. All requests were > serviced > evenly and we experienced no timeouts. However, the attached jkstatus > page shows some interesting results. The 'Busy' and 'Max' values for > the two workers are vastly different. For worker1, these values just > keep incrementing. Also, worker2 has serviced way more requests. > The 'Busy' and 'Max Busy' numbers in the other table keep growing > as well. Is this behaviour normal? or does this point to a problem > somewhere in the configuration? > > As we add more clients, the time it takes to service requests gets > more and > more imbalanced. Some requests get serviced in < 1 second, others can > take 20 or 30 seconds. The more clients we add, the longer it takes for > some requests to get serviced. > > We are using apache 2.26, mod_jk 1.2.26 and tomcat 6.0.14 , JRE > 1.5_06-b05 > Apache and worker1 are on the same box. worker2 is in a different box > > > > We are relly new on this(balancer), as you can see below we were using > tomcat 5.5.20 , apache 2.2.0 and mod_jk 1.2.25 so we updated them all > , but still same problems > > > > Thanks a lot for your help > > > > Rainer Jung wrote: > >> Julio Cesar Leiva schrieb: >> >>> Hi all >>> >>> We have this setup >>> >>> 1 web server apache 2.2.0 >> >> >> I hope it's not 2.2.0 but something more recent (e.g. 2.2.4 or 2.2.6) >> >>> 2 tomcat servers tomcat 5.5.20 >>> mod_jk 1.2.25 >>> >>> This is our workers.properties >> >> >> Remove the next line, it's useless. >> >>> workers.java_home=/usr/lib64/jvm/java >> >> >>> worker.list=cbnbalancer,jkstatus >> >> >> Maybe add connect_timeout and prepost_timeout to the next two, and if >> it makes sense for the app also reply_timeout. See >> >> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html >> >>> # Set properties for worker1 (ajp13) >>> worker.worker1.type=ajp13 >>> worker.worker1.host=172.20.23.12 >>> worker.worker1.port=8009 >>> worker.worker1.lbfactor=1 >>> #worker.worker1.connection_pool_timeout=600 >>> #worker.worker1.socket_keepalive=1 >>> #worker.worker1.socket_timeout=60 >>> worker.worker1.socket_timeout=0 >>> # Define prefered failover node for worker1 >>> worker.worker1.redirect=worker2 >>> >>> # Set properties for worker2 (ajp13) >>> worker.worker2.type=ajp13 >>> worker.worker2.host=172.20.21.211 >>> worker.worker2.port=8009 >>> worker.worker2.lbfactor=1 >>> #worker.worker2.connection_pool_timeout=600 >>> #worker.worker2.socket_keepalive=1 >>> #worker.worker2.socket_timeout=60 >>> worker.worker2.socket_timeout=0 >>> # Define prefered failover node for worker2 >>> worker.worker2.redirect=worker1 >> >> >> method T (Traffic) does only make sense, if you are bandwidth limited >> in the network and thus want to balance w.r.t bytes transferred. >> >>> # Set properties for balancer which use worker1 and worker2 >>> worker.cbnbalancer.type=lb >>> worker.cbnbalancer.method=T >>> worker.cbnbalancer.balance_workers=worker2,worker1 >>> # Enable sticky-sessions (aka session affinity) >>> worker.cbnbalancer.sticky_session=1 >>> >>> # Define a 'jkstatus' worker using status >>> worker.jkstatus.type=status >>> # Add the jkstatus mount point >> >> >> Maybe a little simpler, if you omit the trailing '*', thus mapping >> the exact URL /jkmanager/. >> >>> JkMount /jkmanager/* jkstatus >>> # Enable the JK manager access from localhost only >>> >>> >>> This is part of one server.xml >> >> >> connectionTimeout=600000 would be a good fit to the 600 in your jk >> configuration. >> >> 2000 Threads is a lot, are you sure, that your OS can create that >> many Threads for a JVM (Memory issues possible)? If you only allow >> 700 parallel requests in Apache, you don't need more than 700 (+1?) >> threads in the AJP connector. >> >>> >>> >>> >> minSpareThreads="100" maxSpareThreads="150" maxProcessors="0" >>> protocol="AJP/1.3" connectionTimeout="0"/> >>> >>> This is the second tomcat >>> >>> >>> >> minSpareThreads="100" maxSpareThreads="150" maxProcessors="0" >>> protocol="AJP/1.3" connectionTimeout="0"/> >>> >>> This is part of the apache conf >> >> >> Which mpm, prefork? >> >>> # number of server processes to start >>> # >>> http://httpd.apache.org/docs/2.2/mod/mpm_common.html#startservers >>> StartServers 5 >>> # minimum number of server processes which are kept spare >>> # >>> http://httpd.apache.org/docs/2.2/mod/prefork.html#minspareservers >>> MinSpareServers 5 >>> # maximum number of server processes which are kept spare >>> # >>> http://httpd.apache.org/docs/2.2/mod/prefork.html#maxspareservers >>> MaxSpareServers 10 >>> # highest possible MaxClients setting for the lifetime of the >>> Apache process. >>> # >>> http://httpd.apache.org/docs/2.2/mod/mpm_common.html#serverlimit >>> ServerLimit 700 >>> # maximum number of server processes allowed to start >>> # >>> http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients >>> MaxClients 700 >>> # maximum number of requests a server process serves >>> # >>> http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild >>> >>> MaxRequestsPerChild 10000 >>> >>> >>> We are trying to test this with 600 clients , when we reach 200 , >>> everything gets stuck.... >>> >>> any ideas? >>> >>> Thanks in advance four your help >>> >>> JulioC. >> >> >> How do clients relate to parallel requests? >> What's the throughput before it gets stuck? >> What does a Java Thread Dump of Tomcat tell you? >> What is the status in the jk status worker? >> Which kind of errors in the jk log do you get? >> >> Regards, >> >> Rainer >> >> >> --------------------------------------------------------------------- >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org -- Regards Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement http://www.ngasi.com NEW! 8.0 - Centrally manage multiple physical servers --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org