• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help to choose a strategy to put many Spring Boot apps on a server

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At our organization we have many internal Spring MVC applications running on Tomcat on a Windows server.  The problem is that the number of applications make Tomcat take 10 minutes to start, so even a simple server bounce during the day is a problem.  We also have no Tomcat sysadmins or deploy admins, so the job falls on developers, and we have no expertise on how to optimize servers... the best we have been able to do is to keep the servers stable.

We are looking at Spring Boot with embedded Tomcat as a way to allow us to bounce applications independently instead of an overall Tomcat container.  We have a couple concerns and I am hoping someone can point me in the right direction:

- Since all of the embedded Tomcat instances will use the same version, is it possible for them to share the Tomcat code even as they have independent memory spaces for the apps?  It seems wasteful to load so many copies of the same read-only thing.  Same thing for Java itself, it would be even crazier to have to include a separate copy of Java for each webapp.

- What is the best way to deploy?  Googling seems to point to using a container, and more specifically to deploy the embedded Tomcat Spring Boot apps on Docker.

- Is Docker included in the Windows Server license?  Googling seems to hint so... but it is not clear.


I apologize if these are truly noob questions but google did not help, if anything it added to the confusion as every tutorial seems to be lobbying to sell you a tool instead of helping you choose the best fit.

Also, if going the Spring Boot way is overkill... please say so.  Simpler is always better, if there is such a way.
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bruno Melloni wrote:
- Since all of the embedded Tomcat instances will use the same version, is it possible for them to share the Tomcat code even as they have independent memory spaces for the apps?  It seems wasteful to load so many copies of the same read-only thing.  Same thing for Java itself, it would be even crazier to have to include a separate copy of Java for each webapp.
- What is the best way to deploy?  Googling seems to point to using a container, and more specifically to deploy the embedded Tomcat Spring Boot apps on Docker.

- Is Docker included in the Windows Server license?  Googling seems to hint so... but it is not clear.


I apologize if these are truly noob questions but google did not help, if anything it added to the confusion as every tutorial seems to be lobbying to sell you a tool instead of helping you choose the best fit.

Also, if going the Spring Boot way is overkill... please say so.  Simpler is always better, if there is such a way.



Spring Boot aims to be a self-contained java application, with every dependency packaged into a single, fat jar file. Including Tomcat runtime as Web Application Server, or Jetty, if you tell Spring Boot to use it. Jetty should have a reduced memory footprint with respect to Tomcat, but there's no huge saving in term of memory. If you deploy your applications as standalone boot application, you'll end to have n Tomcat runtimes  running all together on your server. So, yes, IMHO your concerns are right, things may be even worse with respect to memory consumption. On the other hand, splitting a monolithic installation in several, separated standalone apps will bring undoubtly some advantages: there would be nothing like a "general crash" of all your apps, because each of them work separately.
When dealing with Spring Boot applications, Docker is definitely a way to go. It's quite simple to dockerize a spring boot application, and there are plenty of tutorials on the way teaching you  how to proceed. You won't save memory anyway - a containerized application requires the same memory as before.
With docker, anyway, it's really much more simple to manage your running application and to set-up them to automatically restart if any crashes.
About licenses: AFAIK, Docker community edition is free for use. Don't know anything about Enterprise edition, which I suppose will required a regulard, paid subscriptions.
But for a starter, using CE editoin should be enough.


 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can run multiple Tomcats on a single server as long as each one is assigned unique TCP/IP ports (due to OS restrictions on one app per port). You can share CATALINA_HOME and have a separate CATALINA_BASE for each Tomcat instance.

You can also hot-deploy apps in Tomcat, and since they finally got rid of the dreaded PermGen, you should be able to do so without the memory issues that previous JVMs ran into. No need in many cases to bounce the whole server.

Docker is a viable way to run Spring Boot Tomcat instances. If you generate off the same base image, Docker will be sharing the lower layers of their common OS and Tomcat files. However, I'm not sure what the current state of Windows hosting Docker is, since Docker is designed for Linux. If you've got lots of Docker containers, consider using Kubernetes or a similar container control panel to manage them, especially if the sysadmins are not overly savvy.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic