Bug 51366 - One process per webapp
Summary: One process per webapp
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 15:55 UTC by Gili
Modified: 2011-06-13 17:29 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gili 2011-06-13 15:55:12 UTC
I don't know whether this proposal has been made before so I apologize in advance if I'm rehashing an old idea. I'd like to propose a simple but powerful architectural change: each webapp should run in its own JVM.

Benefits:

* Ability to manage resources (memory, cpu, etc) on a per-webapp level
* Improved fault-tolerance (a failing webapp won't take others down with it)
* Ability to load JNI libraries from webapps without having to jump through any hoops or running into "java.lang.UnsatisfiedLinkError: Native Library x already loaded in another classloader."

Please let me know what you think.
Comment 1 Mark Thomas 2011-06-13 16:03:37 UTC
Just run multiple Tomcat instances. The overhead is minimal.
Comment 2 Gili 2011-06-13 16:18:29 UTC
Mark,

This isn't a matter of overhead. It's a matter of convenience. By providing a single management interface for multiple webapps you could enhance productivity that is not possible by using separate Tomcat instances today.

For example: when a user asks to reload a webapp, you could preload Tomcat-minus-webapp sitting idle in the background. When the reload requests come in you simply shut down the old JVM and load the new webapp into the waiting JVM. If I were to implement this today the act of shutting down an instance and relaunching it serially would take a lot longer (and thereby reduce development productivity).

What do you think?
Comment 3 Gili 2011-06-13 16:26:20 UTC
If you don't accept the premise of a full-blown architectural change, is it possible to convert this RFE into a mechanism for reloading the webapps in the manner specified above? It would fix the UnsatisfiedLinkError I mentioned above, memory leak problems that have been plaguing us for years, while maintaining quick reloads.
Comment 4 Pid 2011-06-13 16:54:14 UTC
(In reply to comment #3)
> If you don't accept the premise of a full-blown architectural change, is it
> possible to convert this RFE into a mechanism for reloading the webapps in the
> manner specified above? It would fix the UnsatisfiedLinkError I mentioned
> above, memory leak problems that have been plaguing us for years, while
> maintaining quick reloads.

Have a read of:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment

If you want to discuss this, the Users List is the place to do it.