top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Does Tomcat server support Graceful Shutdown? [CLOSED]

+1 vote

Does Tomcat server support Graceful Shutdown (like all other App Servers: Weblogic, Websphere), where new requests are rejected, and the server finishes in-flight work on existing requests?

Something like the apachectl -k graceful, but instead to restart to stop the server.

closed with the note: No more action required, as problem now seems to be solved.
posted Jul 30, 2014 by Sridharan

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
What you describe is the default behaviour although Tomcat only waits a relatively short time (10s ?) for in-flight requests to complete.
This behavior exists using the regular script? Is the timeout (10s) configurable?
This behavior exists using the regular script?

Is the timeout (10s) configurable?
./$CATALINA_HOME/bin/ stop 30

(30 sec. wait)

Don't remember same option inside, but anyway - it call with stop option. stop 30 will only wait 30 seconds to check to see if the process stopped: it will not force a shutdown.

Under default setup, Tomcat will only perform a graceful shutdown. That is, no explicit process termination will occur. A SHUTDOWN command is sent to the server which will pause the connectors (so they will not accept new connections) but any in-progress connections will complete, the thread pool(s) will drain, etc.

If you use:

$ CATALINA_PID=/tmp/ bin/ stop 30 -force

... then will wait 30 seconds and then try to kill the JVM using "kill -9" once per second for 5 seconds until the process is dead or the 5 tries don't work.

Similar Questions
+1 vote

I am currently running RHEL 6.5 on a 64-bit laptop, and installed a new fedora 20 VM using the Virtual Machine Manager -- seemed to work fine, f20 came up, looks good, but now i want to shut it down, so from the f20 console, I selected "Virtual Machine" -> "Shut Down" -> "Shut Down".

Where it *looks* like the VM shuts down, but the VMM window shows "f20 Running"

Should I expect a different result? I was expecting the VMM window to show that that VM was Stopped or something.

+1 vote

I had installed tomcat 8 port 80 on Amazon AWS EC2, but netstat, fuser does show me tomcat on port 80. Browser gives 404 error and connection refused. I wrote to Amazon support for the misery...