• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Tomcat restart takes eternity

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello Everyone

I need your help.

I have 34 API deployed on my server. Every time there is a new war deployment, our ansible process restarts the tomcat. Now, bring down 34 API, and then bringing them back up again requires a lot of time. I just want to ask the experts is there any way that the APIs can be deployed and tomcat restart is not needed?
1. Is there a tomcat auto-deploy feature I could use?
2. Is there any way I could restart tomcat by mentioning only the API name which was deployed so that it restarts on that particular API?

I am a DBA so my knowledge on this topic is limited, please help me, experts. Because of this my DevOps Continues deployment process takes twice the time and with increasing APIs, the time will further increase.

Version details: Apache Tomcat server version 8.0.43 with JVM OpenJDK 1.8.0.111
Red Hat Enterprise Linux Server release 7.3 (Maipo)

Thanks in advance !

 
Saloon Keeper
Posts: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch. In the future, please resist the temptation to fiddle with font sizes and colors.

Tomcat generally shuts down and starts up pretty quickly. Which part is taking a long time? Are there lengthy initializations being run? If so, you may want to run those in the background so they don't delay startup.

You could also structure the APIs into several web apps, and only restart the web apps that changed. That will eventually lead to problems, though, so I don't recommend it in a production setting.

You could also use an OSGi container like Apache Felix or Apache Karaf which are built on the premise of redeployable services.
 
Shwetank Upadhyay
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply Tim, much appreciated. Point noted about the font sizes and colors.

1. Regarding the starting up in the background: there is a problem with that approach as the time remains the same, just that it is restarting all the APIs in the background. So the end-user has to wait for the deployed API to be restarted to see the newly introduced change.
Can you please share the steps of how to restart tomcat in the background, I usually do "service tomcat stop/start" with root user.

2. With the second approach, I agree with you that this approach will eventually lead to issues in the prod env. And yes, I have to take this to the prod env.

3. Would you kindly share some documents that can give me more info on the 3rd approach.

Thanks in advance!
 
Saloon Keeper
Posts: 22126
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Tomcat starts up and shuts down very rapidly, Some webapps I've seen, however, definitely did not. I worked with one whose startup loaded practically an entire database into RAM before it was ready to handle requests. It took over 20 minutes every time I did a new compile-and-test cycle. I finally got fed up and modified it from pre-loading the database to load-on-demand and the startup time dropped to about 1 minute 30 seconds.

A lot of times you have 2 choices: do everything in advance and have instant response on requests, which, as I noted can take a very long time to start, or do everything just-in-time, so that startup is quick, but requests take longer the first time they're made. Or you can mix the two tactics if that works better overall.
 
That is a really big piece of pie for such a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic