2

I have java web app running on tomcat which was based for 32 bit OS and starting and stopping tomcat was taking around 2-4 sec. I have upgraded JRE, Tomcat to 64 bit and tomcat service start fast or normal as it was starting but stopping for 1 min which is long and i'm curious about the time to stop or it is getting killed by windows service manager due to too long stopping time.

Web app is running Spring framework for Rest API and pubnub SDK for http communication which i think it shouldn't make difference between 32 and 64 bit environment for libraries. Also WEB App is running few background tasks but with no complex tasks...

what might be a problem for tomcat to stop that much slow? tried the app to be compiled with 32 bit jdk and 64 bit jdk but result is same.

[2018-04-04 17:49:21] [info]  ( prunsrv.c:984 ) [ 2460] Stopping service...
[2018-04-04 17:49:21] [debug] ( javajni.c:937 ) [  864] argv[0] = stop
[2018-04-04 17:49:21] [debug] ( javajni.c:990 ) [  864] Java Worker thread started org/apache/catalina/startup/Bootstrap:main
[2018-04-04 17:49:21] [debug] ( javajni.c:1013) [ 3336] Java Worker thread finished org/apache/catalina/startup/Bootstrap:main with status = 0
[2018-04-04 17:49:21] [debug] ( javajni.c:1013) [  864] Java Worker thread finished org/apache/catalina/startup/Bootstrap:main with status = 0
[2018-04-04 17:49:21] [debug] ( prunsrv.c:1577) [ 2724] Worker finished.
[2018-04-04 17:49:21] [debug] ( prunsrv.c:1586) [ 2724] Waiting for ShutdownEvent
[2018-04-04 17:49:21] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 60000, dwServiceSpecificExitCode = 0
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1032) [ 2460] Waiting for Java JNI stop worker to finish...
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1034) [ 2460] Java JNI stop worker finished.
[2018-04-04 17:49:22] [debug] ( prunsrv.c:885 ) [ 2460] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 300000, dwServiceSpecificExitCode = 0
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1141) [ 2460] Waiting for worker to die naturally...
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1152) [ 2460] Worker finished gracefully in 0 ms.
[2018-04-04 17:49:22] [info]  ( prunsrv.c:1162) [ 2460] Service stop thread completed.
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1589) [ 2724] ShutdownEvent signaled
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1594) [ 2724] Waiting 1 minute for all threads to exit
[2018-04-04 17:49:22] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 60000, dwServiceSpecificExitCode = 0
[2018-04-04 17:50:22] [debug] ( prunsrv.c:1607) [ 2724] JVM destroyed.
[2018-04-04 17:50:22] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode = 0, dwWaitHint = 0, dwServiceSpecificExitCode = 0
[2018-04-04 17:50:22] [info]  ( prunsrv.c:1645) [ 3836] Run service finished.
[2018-04-04 17:50:22] [info]  ( prunsrv.c:1814) [ 3836] Commons Daemon procrun finished

Here are logs after trying to stop the tomcat service, especially interesting from: 17:49:22 to: 17:50:22

Emrah Mehmedov
  • 1,492
  • 13
  • 28

1 Answers1

0

As stated in the doc, Tomcat uses procrun for its service utility. When installing the service, there is one parameter that you should add : --StopTimeout followed by the waiting time you allow your service (try 2 or 3 seconds for example).

Eugène Adell
  • 3,089
  • 2
  • 18
  • 34