Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mladen, On 11/26/19 15:49, Mladen Adamović wrote: > Our setup is documented here: > https://mladenadamovic.wordpress.com/2016/09/06/configure-tomcat-with- ssl-on-ubuntu-minimal/ When > I read it in your documentation, I assumed it was just

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-26 Thread Mladen Adamović
Hi Chris, On Tue, Nov 26, 2019 at 7:51 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > You never actually said what your definition of "high CPU usage" was. > Are you looking at load-average? %-CPU usage from "top"? > I'm sorry if I wasn't clear enough, I meant high system load

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mladen, On 11/26/19 11:13, Mladen Adamović wrote: > I dig into Tomcat source code and from what I've seen this is what > happens: > > Tomcat "worker thread", tries the polls the work and if it doesn't > succeed it invokes sun.misc.Unsafe.park

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-26 Thread Mladen Adamović
I dig into Tomcat source code and from what I've seen this is what happens: Tomcat "worker thread", tries the polls the work and if it doesn't succeed it invokes sun.misc.Unsafe.park (that's waiting which can be interrupted by another thread), internally in Linux goes through kernel function

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mladen, On 11/25/19 14:36, Mladen Adamović wrote: > On Mon, Nov 25, 2019 at 5:57 PM Christopher Schultz < > ch...@christopherschultz.net> wrote: > >>> We certainly want to be able to serve 1 hits per second >>> (!), while some connections

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-25 Thread Mladen Adamović
On Mon, Nov 25, 2019 at 5:57 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > > We certainly want to be able to serve 1 hits per second (!), > > while some connections might be stalled. > > What might stall a connection? The network, or the application (or > database, etc.)? >

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mladen, On 11/25/19 11:28, Mladen Adamović wrote: > On Mon, Nov 25, 2019 at 4:54 PM Christopher Schultz > > wrote: > > 50k connections is quite a lot. Is this a physical or virtual > server? Do you expect to

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-25 Thread Mladen Adamović
Hi Christopher, the answers is inline. On Mon, Nov 25, 2019 at 4:54 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > 50k connections is quite a lot. Is this a physical or virtual server? > Do you expect to have lots of long-lived connections that are mostly > idle (e.g.

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mladen, On 11/24/19 04:57, Mladen Adamović wrote: > I couldn't find the explanation of this in other threads, I've > tried to search the archive. > > I have a high load average on a server and the reason for that is > kernel function futex_wait

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-24 Thread Mladen Adamović
Hi Manna, I didn't copied full stack, it seems most threads are actually in TaskQueue.poll, see the full thread trace: Thread 1714: (state = BLOCKED) - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information may be imprecise) -

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-24 Thread Mladen Adamović
Tomcat 8.5.5 Java 1.8.0_101 OS: Ubuntu 4.4.0-38-generic On Sun, Nov 24, 2019 at 11:36 AM Mark Thomas wrote: > Tomcat version? > > Operating system? > > Java version? > > Mark > > > On 24/11/2019 09:57, Mladen Adamović wrote: > > I couldn't find the explanation of this in other threads, I've

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-24 Thread M. Manna
I’m suspecting it’s the same issue that we found out for 8.5.45 where the commit didn’t get reverted out in Poll.java Or maybe not. Thanks, On Sun, 24 Nov 2019 at 10:36, Mark Thomas wrote: > Tomcat version? > > Operating system? > > Java version? > > Mark > > > On 24/11/2019 09:57, Mladen

Re: CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-24 Thread Mark Thomas
Tomcat version? Operating system? Java version? Mark On 24/11/2019 09:57, Mladen Adamović wrote: > I couldn't find the explanation of this in other threads, I've tried to > search the archive. > > I have a high load average on a server and the reason for that is kernel > function futex_wait

CPU high usage, the reason org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run

2019-11-24 Thread Mladen Adamović
I couldn't find the explanation of this in other threads, I've tried to search the archive. I have a high load average on a server and the reason for that is kernel function futex_wait invoked by java thread. By doing jstack, I see a lot of BLOCKED threads like these: Thread 1725: (state =