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 8BC4C1071E for ; Sun, 3 May 2015 16:37:41 +0000 (UTC) Received: (qmail 19215 invoked by uid 500); 3 May 2015 16:37:38 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 19145 invoked by uid 500); 3 May 2015 16:37:38 -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 19134 invoked by uid 99); 3 May 2015 16:37:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 16:37:38 +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: message received from 54.164.171.186 which is an MX secondary for users@tomcat.apache.org) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 16:37:30 +0000 Received: from h1611079.stratoserver.net (h1611079.stratoserver.net [81.169.162.220]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 1AF70455E0 for ; Sun, 3 May 2015 16:37:09 +0000 (UTC) Received: from android-71f42671500da990.fritz.box (dslb-094-221-110-135.094.221.pools.vodafone-ip.de [94.221.110.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by h1611079.stratoserver.net (Postfix) with ESMTPSA id BD0C1494805E for ; Sun, 3 May 2015 18:36:01 +0200 (CEST) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: High cpu on Tomcat 8 From: Felix Schumacher Date: Sun, 03 May 2015 18:35:56 +0200 To: Tomcat Users List Message-ID: <3739A6EC-36A2-4BDB-BF8B-D7A08BB349D4@internetallee.de> X-Virus-Checked: Checked by ClamAV on apache.org Am 3. Mai 2015 12:25:53 MESZ, schrieb Greg Huber : >Hello, > >After an upgrade to Tomcat 8.0.21 and (Oracle jdk1.8.0_40) I seem to be >having an erratic high cpu issue, often when the server gets busy. >The >application was OK tomcat 7 and has not been modified since the >upgrade. > >I use mod_jk / apache > ># ># workers.properties ># > ># Define 1 real worker using ajp13 >worker.list=worker1 ># Set properties for worker1 (ajp13) >worker.worker1.type=ajp13 >worker.worker1.host=localhost >worker.worker1.port=8009 >worker.worker1.lbfactor=50 >worker.worker1.socket_keepalive=1 > >Here are my startup options: > >Tomcat 7 >JAVA_OPTS="-Xms128M -Xmx512m -XX:MaxPermSize=256m" > >Tomcat 8 (java 8 does not support MaxPermSize) > >JAVA_OPTS="-Xms128M -Xmx512m" I believe java 8 combines the permgen into the heap space, so it is possible, that you run out of space now that you use java 8. Use jstat, jvisualvm or jconsole to look at your gc cycles. They can consume a lot of cpu. > >If I trace the thread it seems to be related to ajp-apr-8009-Poller > >"ajp-apr-8009-Poller" #26 daemon prio=5 os_prio=0 >tid=0x00007ffe300bd000 >nid=0xc82 runnable [0x00007ffdd1fd1000] > java.lang.Thread.State: RUNNABLE > at sun.misc.Unsafe.unpark(Native Method) This thread does nothing. > at java.util.concurrent.locks.LockSupport.unpark(LockSupport.java:141) > at >java.util.concurrent.locks.AbstractQueuedSynchronizer.unparkSuccessor(AbstractQueuedSynchronizer.java:662) > at >java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1264) > at >java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457) > at >java.util.concurrent.LinkedBlockingQueue.signalNotEmpty(LinkedBlockingQueue.java:176) > at >java.util.concurrent.LinkedBlockingQueue.offer(LinkedBlockingQueue.java:430) > at org.apache.tomcat.util.threads.TaskQueue.offer(TaskQueue.java:74) > at org.apache.tomcat.util.threads.TaskQueue.offer(TaskQueue.java:31) > at >java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1361) > at >org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:161) > at >org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:141) > at >org.apache.tomcat.util.net.AprEndpoint.processSocket(AprEndpoint.java:896) > at org.apache.tomcat.util.net.AprEndpoint$Poller.null (Redefined) > at java.lang.Thread.run(Redefined) > >.... > >"ajp-apr-8009-Poller" #26 daemon prio=5 os_prio=0 >tid=0x00007ffe300bd000 >nid=0xc82 runnable [0x00007ffdd1fd1000] > java.lang.Thread.State: WAITING (parking) > at sun.misc.Unsafe.park(Native Method) This thread does nothing, either. > - parking to wait for <0x00000000e4a05160> (a >java.util.concurrent.locks.ReentrantLock$NonfairSync) > at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) > at >java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836) > at >java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870) > at >java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199) > at >java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209) >at >java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285) > at >java.util.concurrent.LinkedBlockingQueue.signalNotEmpty(LinkedBlockingQueue.java:172) > at >java.util.concurrent.LinkedBlockingQueue.offer(LinkedBlockingQueue.java:430) > at org.apache.tomcat.util.threads.TaskQueue.offer(TaskQueue.java:74) > at org.apache.tomcat.util.threads.TaskQueue.offer(TaskQueue.java:31) > at >java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1361) > at >org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:161) > at >org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:141) > at >org.apache.tomcat.util.net.AprEndpoint.processSocket(AprEndpoint.java:896) > at org.apache.tomcat.util.net.AprEndpoint$Poller.null (Redefined) > at java.lang.Thread.run(Redefined) > > >Killing the thread stops the cpu, but then Tomcat does not work. Any >ideas >what would be causing this? You might look for other threads, that do something. I would be especially suspicious about array resizing operations. Regards Felix > > >Cheers Greg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org