Chris,

Looking at JMX is the next step.  I make a request and Tomcat never returns, 
and I do not get a “connection refused”.  It just sits and hangs.

Regards,

William Crowell

From: Christopher Schultz <ch...@christopherschultz.net>
Date: Tuesday, March 25, 2025 at 7:20 AM
To: users@tomcat.apache.org <users@tomcat.apache.org>
Subject: Re: NIO Thread Madness
William,

On 3/24/25 2:56 PM, William Crowell wrote:
> I am running Apache Tomcat 9.0.97 on Windows Server 2022.  I’m running Oracle 
> JDK 1.8.0_371-b11 with a 4GB min heap and a 16GB max heap.
>
> I have an application deployed on this server that is hitting an Oracle 
> database server.  I have noticed the server stops accepting requests after 
> about 8-12 hours of uptime.  In JProfiler you can tell when this is about to 
> happen because 20 of the 150 NIO threads BRIEFLY…BRIEFLY go into a blocked 
> state while querying the database.  After this situation clears up, the NIO 
> thread pool grows slightly by about 15-20 threads, and then the application 
> server stops serving requests.
>
> I looked at the GC log, and it looks completely healthy, and we are not even 
> close to our max heap.  Metaspace size is not configured, but it looks fine 
> from the GC logs.  There is no crash file or core dump produced.
>
> I do notice some Oracle exceptions in the logs when this happens.  We do have 
> about 1000 max connections defined on the Oracle database (which is too many).

Are you able to use JMX or similar to see how many used database
connections you have?

When you say that Tomcat does not accept requests, do you mean that you
make a request and it never returns, or do you mean that you get a
"connection refused" or something similar?

> I have my thread pool defined as follows in server.xml:
>
> …
>       <Executor name="tomcatThreadPool"
>            namePrefix="catalina-exec-"
>            maxThreads="1000"
>            minSpareThreads="50"
>            maxIdleTime="60000"
>            maxQueueSize="1000" />
>
>       <Connector port="8080"
>             protocol="org.apache.coyote.http11.Http11NioProtocol"
>             connectionTimeout="130000"
>             redirectPort="8443"
>             disableUploadTimeout="false"
>             acceptCount="1000"
>             maxConnections="1000"
>             executor="tomcatThreadPool" />

Have you tried enabling any of the "abandoned"-related settings? I
highly recommend logAbandoned="true" and possibly others.

I would imagine you'd see threads waiting on database connections if you
had exhausted your pool. Just remember that threads can be stuck on
things without being BLOCKED.

 > Are there any logs I can enable to find out why the application
server stops accepting connections?

-chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



CAUTION: This email originated from outside of the organization. Do not click 
on links or open attachments unless you recognize the sender and know the 
content is safe.


This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and any attachments 
and notify us immediately.

Reply via email to