-2

I want to use more than one copy of the similar application in the shared tomcat and I want to increase the memory size, so is there any risk of this action ?? How I can increase the Performance?

Session switching, Security, Integrity, Performance issue, Threads risk, Deadlocks

Ahmad Al-Kurdi
  • 2,248
  • 3
  • 23
  • 39
  • 1
    Why would you do this? This is a very low-footprint servlet container and you should easily be able to run multiple instances. There are all kinds of different problems you can run into when deploying multiple applications to the same server. If one application crashes the jvm, then all the other applications goes down. If you need to restart the server, all applications will have downtime. The general rule should be one server for each application. – jorgen.ringen Jun 05 '15 at 06:31

2 Answers2

1

Actually there could be only performance impact. In case you don't share your one thread pool between different applications (you can do this in tomcat) you shouldn't receive any Thread/Deadlocks risks.

But under Performance impact — I mean in comparing with launching applications on different servers. There are no significant performance difference between launching few applications on single tomcat or launching few tomcat with sing applications on board.

BUT: there are at least few limitation:

  • you can't use different versions of shared libraries. If you looks on ./lib folder in tomcat — there are some libraries like jsp-api, servlet-api, jasper. If you applications limited to use different specific versions — it can be an issue (it can be solved also, but it is addition limitation).
  • to reload/update one application in some cases you need reload tomcat, so you need stop/start all applications hosted on this tomcat.

With one of benefits launch few applications in one tomcat — you can save some RAM. Example: if few of your application use same library — you can move it on ./lib folder, so this library will be picked up in memory only once (not as once per each application).

P.S. Web applications can be hosted in many ways, personally I prefer two concepts: many micro-services with embedded webserver(tomcat/jetty) in case of using SOA/microservice architecture or hosting few applications on single tomcat in other ways.

iMysak
  • 2,170
  • 1
  • 22
  • 35
1

Session switching :- No impact

Security :- No Impact

Integrity :- No Impact

Performance issue :- Yes there will be impact as single webserver has to process all request.I look at it this way cpu cylce given to one tomcat vs two separate tomcat. Also each application will be needing some memory so you need to tune memory settings also. See Multiple applications in single Tomcat vs multiple instances of tomcat

Threads risk :- No Impact

Deadlocks :- No Impact

Community
  • 1
  • 1
M Sach
  • 33,416
  • 76
  • 221
  • 314