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 35B47184EE for ; Thu, 16 Jul 2015 15:45:38 +0000 (UTC) Received: (qmail 99361 invoked by uid 500); 16 Jul 2015 15:45:34 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 99299 invoked by uid 500); 16 Jul 2015 15:45:34 -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 99288 invoked by uid 99); 16 Jul 2015 15:45:34 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2015 15:45:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E02F5D521D for ; Thu, 16 Jul 2015 15:45:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.998 X-Spam-Level: ** X-Spam-Status: No, score=2.998 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id oCYiP2GyaNRB for ; Thu, 16 Jul 2015 15:45:32 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 596F12110B for ; Thu, 16 Jul 2015 15:45:32 +0000 (UTC) Received: by ieik3 with SMTP id k3so59024881iei.3 for ; Thu, 16 Jul 2015 08:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=lwJn4h789JIeHnQQ2GWq4/qFoJenmm2Sqh+L1SFVfEc=; b=SujG1m61WgrCOocwjcogTlOx+F3PIze7sFckBgYtygd0HaCmIgWWgeC/rBgRxLxoI0 k3c16oekslXuTdHrR1XbNxpUP11WZlyec4o+89t1vCuRHo/Ae2hAATDN7izxFMxmN6Jo +Rj9L0GcydAtnKd4Zcwi1XVW0LXlVwA6ZR/x8UGWuCwc6Tb1f6VLUdmoLsh0NFrgeyyt 6RyTcRZKFnQXMMGwFNiUsMtkmhnNYY+h2bf+DUZUGCkqVVAQNO2bKBf2WhyMZnaRqWrp UCrfZf0pHl9yyFB1Z+TahZ0t4ibGz7pAjQ+E7amZQSUqqYX/hJ9jTC/Mr6UhCbM12bNh +Hfw== X-Gm-Message-State: ALoCoQklFnbSKzHZxrpvcNmljaT6JzCBgtpqZzfF2PtPPxM6XZhZxKcIklfTbc5ZlEAgBq4UllLS MIME-Version: 1.0 X-Received: by 10.107.35.203 with SMTP id j194mr12703199ioj.45.1437061486756; Thu, 16 Jul 2015 08:44:46 -0700 (PDT) Received: by 10.36.105.1 with HTTP; Thu, 16 Jul 2015 08:44:46 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Jul 2015 11:44:46 -0400 Message-ID: Subject: Re: Many Threads in TIMED_WAITING (parking) - [org.apache.tomcat.util.threads.TaskQueue] From: Daniel Mikusa To: Tomcat Users List Content-Type: multipart/alternative; boundary=001a11404440706da6051afff3f1 --001a11404440706da6051afff3f1 Content-Type: text/plain; charset=UTF-8 On Thu, Jul 16, 2015 at 10:37 AM, Robert Anderson wrote: > Hi, > > Sometimes, in moments of high traffic for our patterns (170 req/sec), we > have a lot of threads like that: > > "ajp-apr-8009-exec-115 ^ 16/07/2015 - 11:13:37 - End of Execute" daemon > prio=10 tid=0x00002aaab5c36800 nid=0x12f9 waiting on condition > [0x000000004ddcb000] > java.lang.Thread.State: TIMED_WAITING (parking) > at sun.misc.Unsafe.park(Native Method) > - parking to wait for <0x0000000609a53198> (a > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) > at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226) > at > > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082) > at > java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467) > at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86) > at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32) > at > > java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) > at > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at > > org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) > at java.lang.Thread.run(Thread.java:745) > This is not a problem. The thread is in the pool waiting for work. It's what you'd normally see on a server that's not handling any requests. > > Thus, Tomcat hangs (all available threads stay in that state) and we have > to restart the service. > > Server version: Apache Tomcat/7.0.63 > Server built: Jun 30 2015 08:08:33 UTC > Server number: 7.0.63.0 > OS Name: Linux > OS Version: 2.6.18-194.17.1.el5 > Architecture: amd64 > JVM Version: 1.7.0_80-b15 > JVM Vendor: Oracle Corporation > > We are using tomcat-native (APR connector) and Apache (2.2.3) as load > balancer with mod_jk. > > > server.xml > > > > SSLEngine="off" /> > > className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> > className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> > > type="org.apache.catalina.UserDatabase" > description="User database that can be updated and saved" > factory="org.apache.catalina.users.MemoryUserDatabaseFactory" > pathname="conf/tomcat-users.xml" /> > > > > > connectionTimeout="20000" > redirectPort="8443" /> > protocol="AJP/1.3" redirectPort="8443" /> > > > > > resourceName="UserDatabase" digest="SHA"/> > > > unpackWARs="true" autoDeploy="true"> > > threshold="60" interruptThreadThreshold="120" /> > > > > > > > Any suggestions? > This could be an issue with HTTPD talking to Tomcat. - When the problem occurs, check the access logs for both and see if the request is making it from HTTPD to Tomcat. - Also when the problem occurs, try hitting Tomcat directly while the problem is occurring. See if you can access your app when you bypass HTTPD. - Post your HTTPD config - Make sure timeouts are configured appropriately - http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html Do you have a firewall in between HTTPD & Tomcat? Is there anything that could be breaking the connection? Dan --001a11404440706da6051afff3f1--