Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 78651 invoked from network); 4 Nov 2010 23:27:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Nov 2010 23:27:06 -0000 Received: (qmail 93545 invoked by uid 500); 4 Nov 2010 23:27:34 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 93349 invoked by uid 500); 4 Nov 2010 23:27:32 -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 93340 invoked by uid 99); 4 Nov 2010 23:27:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 23:27:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of desjter@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 23:27:26 +0000 Received: by qwf6 with SMTP id 6so1917480qwf.18 for ; Thu, 04 Nov 2010 16:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=M+7HNpifXAy6GZg+2BIaCeHYPH0c79+Ar/AlBeBk0Iw=; b=d2jMG+PhI+BjoiYjglT5rObDnQPrRaJLlwXgBo7JZSXVRn3GITc/1c7xDyjKmkq8Kt 2oPmwc2qQZEfvDHFEEyWl/RlXRSvwKDD/fhThxqbWGOtfMhKSKPMHd/W/5RVX7+13Z5Z H9V34h4peYuE2sYbuyMFW4/XJOvUKWF+esHyo= 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; b=XeRGTvjeskDW9cJVzSUL4s3lFa9Q1JJB6bHo0Vavic2SACOzmSM/O8jaVxor+ssRR4 3ZX2nKY8yIdqObu6u8OcPhjNU1kiqfN4zBtzs7kSya8WWzGHiOsgV9x259Q6kPPx0mGa 7uFy547/RLowtfETYhgVApaQv15Tc9H9rHDt4= MIME-Version: 1.0 Received: by 10.229.227.8 with SMTP id iy8mr1284371qcb.36.1288913225888; Thu, 04 Nov 2010 16:27:05 -0700 (PDT) Received: by 10.229.86.129 with HTTP; Thu, 4 Nov 2010 16:27:05 -0700 (PDT) In-Reply-To: <4CC952F3.2060503@kippdata.de> References: <4CC6F508.6010704@apache.org> <4CC952F3.2060503@kippdata.de> Date: Fri, 5 Nov 2010 00:27:05 +0100 Message-ID: Subject: Re: mod_jk makes ajp connector run out of free connections From: Marc Wilmots To: Tomcat Users List Content-Type: multipart/alternative; boundary=00163630faa9f9b6d90494427e2d --00163630faa9f9b6d90494427e2d Content-Type: text/plain; charset=ISO-8859-1 Rainer, that's very true. So I am wondering...If 1200 > 200 (Tomcat maxThreads), then what would be the right way to solve this? Imagine that 2 Tomcats would crash, that would leave me with 1200 > 400. I can't just raise the maxThreads to 600 for each Tomcat, as that would probably perform even worse (I'm thinking about excessive context switching, etc). The best solution would be to enable DisableReuse as Mark stated, although I'm afraid that would be too big of a performance hit. The other option would be to configure the connection_pool_size, according to Mladen's link. Although, this last one isn't very clear to me either. I state from the URL Mladen passed: *"There are 4 JBoss servers each containing 1 JBoss instance(s) giving a total of 4 mod_jk workers* *Given the ThreadsPerChild of 60 and the MaxClients (600) / ThreadsPerChild (60) = Processes (10) and with 2 Apache instance(s) then the connection_pool_size has been best determined to be 15* *The total Jboss threads 1600 are > the total Apache threads 1200. The mod_jk connection_pool_size was determined to be 15 via the math 600 Apache MaxClients / 4 total Jboss instances 150 threads per JBoss which will be equal to or less than the maxThreads 400 150 / 10 Apache server processes to get the connection_pool_size of 15. in Jboss. Take this number"* I'm wondering, setting connection_pool_size 15, wouldn't this mean that the maximum number of connections being handled by tomcat at one time is limited to 15?? Or would there be a pool per Apache server process? Which would mean 150 connections (10 server processes) per Tomcat. If so, then this would total 600 connections (4 Tomcats). 1200 > 600. Same problem, right? 2010/10/28 Rainer Jung > On 26.10.2010 20:36, Marc Wilmots wrote: > >> 2010/10/26 Mladen Turk >> >> On 10/26/2010 02:47 PM, Marc Wilmots wrote: >>> >>> Hi Experts, >>>> >>>> I have the following setup: >>>> >>>> Apache1 >>>> / \ >>>> Apache2 Apache3 >>>> \ / >>>> Tomcat1 >>>> >>>> All Apaches are version 2.2.3 (RedHat) >>>> Apache2 and Apache3 loadbalance Tomcat1 (6.0.18) with mod_jk (2.2.28). >>>> >>>> In idle state the AJP connector of Tomcat1 only has 7 active >>>> connections. >>>> After launching a stress test of Tomcat1, it's AJP connector has reached >>>> maxThreads (200). After the stress test has finished, there are still >>>> 200 >>>> active connections in the AJP connector. >>>> >>>> Because of this, apache2 and apache2 cannot receive any heartbeat >>>> message >>>> anymore from the AJP connector and mark Tomcat1 as dead. I can access >>>> perfectly through port 8080, so Tomcat1 isn't dead at all! >>>> >>>> >>>> You have a usual setup problem where the number of connections >>> in httpd fronting tomcat is too high for a tomcat. >>> And you don't have any mechanism for limiting those connections. >>> >>> Sorry, I realize I had to mention I have a total of 4 Tomcats, which in >>> >> total make up a maxThreads of 800 (200 each). >> The Apaches have a maxClients of each 600 (1200 total). >> >> 1200> 1000, thus your theory is probably right. However, I'm just >> wondering... I read that when Tomcat reaches the max number of >> connections, >> just rejects new connections (I'm omitting the backlog on purpose). >> > > Yes. > > But your calculation above is not right. Each Apache will connect to each > Tomcat. So from the point of view of one Tomcat, it has 200 threads, but > 1200 posible incoming connections from the Apache Servers. So it is not 1200 > > 800 but 1200 > 200! > > Regards, > > Rainer > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --00163630faa9f9b6d90494427e2d--