tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pïd stèr <>
Subject Re: multi-tenant web app
Date Tue, 16 Apr 2013 18:52:30 GMT
On 12 Apr 2013, at 12:00, Jamie <> wrote:

> Greetings!
> I would like some advice with regards to deploying a web app in a multi-tenant scenario.
A while back, we had a few cloud service providers ask us if they could host our web app as
a service. Under pressure to come with a quick solution, we responded by implementing a manager
like application (much like the Tomcat manager app), that could deploy additional web apps
by copying the contents of our WAR file to a new directory under webapps . For instance:
> webapps\customer1
> webapps\customer2
> etc.
> This approach works but it presents several problems:
> * When there are a large number of webapps, Tomcat takes a long time
>   to load. This can be mitigated to a minor extent with TC7's new
>   parallel load feature.
> * Tomcat uses alot more memory that it would otherwise since it has to
>   load the classes pertaining to each webapp multiple times
> * The contents of one war file is duplicated several times. When there
>   are a large number of webapps, it becomes difficult to manage all
>   the files and state of the server.
> The advantage of the approach is that each web app can potentially run a different version
of our software.

If it's different versions, you can't avoid loading the jars in each
case, can you?

> My question is - how does one configure TC7 such that it will:
> * Have the ability to load the same webapp multiple times, while
>   pointing it to one WAR file webapp path

Just script the deployment process, if the management overhead is high.

> * Prevent Tomcat from loading the class files and resources of the
>   same WAR file multiple times

Can't be done. You can put jars in tomcat/lib, if they're safe and as
long as you don't put the same jars or different versions of them
elsewhere on the classpath.

> * Start up each app as fast possible

App specific, talk to your devs.

> * Such as that the addition of new instances will be as scalable as
>   possible.

There's no magic bullet & I find that attempts to rationalise like
this often lead to problems later.


> Much appreciate
> Jamie

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message