简体   繁体   中英

Spring Boot embedded tomcat or not embedded tomcat

When I use embedded tomcat to run Spring Boot Application,the tomcat instance will +1. I run another embedded tomcat Spring Boot Application one the same server,the tomcat instance will +2. I wonder if the embedded tomcat will cost much resource.

On the Contrary, not embedded tomcat only exist one instance on the server for many Spring Boot Application.

Is this a vaild idea?

Deploying into one tomcat requires less resources, than running multiple apps with an embedded tomcat. How to deploy often also depends on other requirements :

For production environment I am mostly forced to deploy into a tomcat. Operators prefer this, its their common way to run java apps and gives more tuning options.

Developers run embedded tomcats locally, it allows faster deployment cycles and easier debugging.

When apps run in a cloud, it may be cheaper to use one tomcat for many apps.

I would recommend to support both, creating a war for tomcat and a jar with an embedded tomcat as well. Use spring and maven profiles to provide different configs for both environments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM