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 283A0E79F for ; Thu, 3 Jan 2013 14:44:27 +0000 (UTC) Received: (qmail 86372 invoked by uid 500); 3 Jan 2013 14:44:23 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 86253 invoked by uid 500); 3 Jan 2013 14:44:23 -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 86234 invoked by uid 99); 3 Jan 2013 14:44:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 14:44:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.219.55.137] (HELO mail.polydyne.com) (66.219.55.137) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 14:44:17 +0000 Received: from Unknown [10.1.1.19] by mail.polydyne.com - Websense Email Security (7.2.0); Thu, 03 Jan 2013 08:49:56 -0600 Received: from POSTOFFICE02.polydyne.com ([::1]) by POSTOFFICE02.polydyne.com ([::1]) with mapi id 14.01.0355.002; Thu, 3 Jan 2013 08:43:52 -0600 From: Jeffrey Janner To: 'Tomcat Users List' Subject: RE: Limiting threads per context Thread-Topic: Limiting threads per context Thread-Index: AQHN6b8batjXhJeW/0aNHAQIY8Hfdpg3rCiA Date: Thu, 3 Jan 2013 14:43:51 +0000 Message-ID: <7215BA462D00D343B2837F9113F0131F01277FD695@POSTOFFICE02.polydyne.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.1.27] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SEF-7853D99-ADF1-478E-8894-213D316B8FFA: 1 X-SEF-Processed: 7_2_0_00504__2013_01_03_08_49_57 X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: kharper2@oreillyauto.com [mailto:kharper2@oreillyauto.com] > Sent: Thursday, January 03, 2013 8:31 AM > To: users@tomcat.apache.org > Subject: Limiting threads per context >=20 >=20 > Hello All, >=20 > Yesterday we had a Tomcat6 server reach maxThreads and stay that way > until we restarted it. After researching a thread dump and some log > files, we found one of the applications is creating > NullPointerExceptions and subsequently leaving a TP-ProcessorX in > WAITING state indefinitely for a DB closePreparedStatement return. As > more requests come in for this application threads are being > established and put into BLOCKED state, waiting on TP-ProcessorX. > Eventually, the server hits maxThreads and stops serving requests > almost entirely. >=20 > Obviously the application causing this needs to (and is being) fixed. > But I'm curious if there is a higher level of protection that could be > implemented to help protect the other applications (contexts) on this > server? For example, is there a way to specify that a context can only > use X number of request threads? Or perhaps X number of threads from > an executor? Et cetera. >=20 > I haven't seen anything in the docs that would do this, but it never > hurts to ask. Here's our server info in case it's helpful: > OS: Ubuntu 12.04 64-bit > Front-end Server: Apache 2.2.22 (mod_ajp to back-end via Balancer > setup) Back-end App Server: Tomcat 6.0.24 (AJP & HTTP connectors, no > executor) Java -version output: > java version "1.6.0_20" > OpenJDK Runtime Environment (IcedTea6 1.9.13) > (6b20-1.9.13-0ubuntu1~10.04.1) > OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) >=20 >=20 > Thanks, > Kyle Harper >=20 Kyle - Processor threads are tied to connectors, either directly or via executors.= Therefore, if these are all contexts under one host, or you are sharing t= he connector (IP/port pair) for multiple hosts, I don't think there is anyt= hing you can do. However, since you are front-ending with apache, you might be able to set u= p multiple connectors (IP/port pair) on the Tomcat server and use the front= end to direct each context to a different connector. In this case, you ca= n probably ignore setting up the executors, since you are not going to be s= haring threads between the contexts. Jeff --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org