RE: More apps = More load ?

2004-11-15 Thread Shapira, Yoav

Hi,

> I was discussing this very topic with somebody last night.  This
>sort of begs the question, if the webapp isn't supposed to start
>threads of its own in general, what is the "right" way to handle these
>situations (the most typical being some sort of cron thread, or any
need
>to kick of an asynchronous action)?

Handle by whom?  The container shouldn't (and can't really) prevent it.
So the responsibility is left to the app designer.  If you do start
threads, you need to make sure you control them and terminate them
appropriately.  Marking these threads as daemons is usually good, it
means the JVM can terminate them in the event of an abrupt shutdown.
But it's better to keep a handle to them and make sure to interrupt()
and null them out when they're done or on app shutdown (e.g. a
ServletContextListener#contextDestroyed event), whichever comes sooner.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: More apps = More load ?

2004-11-12 Thread Mike Curwen
I'm going to speculate and say that someone will mention something along the
lines of "... the spirit of the J2EE spec would have you move up to a ejb
container and use EJB/MDB" (or some such).
 

> -Original Message-
> From: Steven J.Owens [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 12, 2004 6:40 PM
> To: Tomcat Users List
> Subject: Re: More apps = More load ?
> 
>
>  I was discussing this very topic with somebody last 
> night.  This sort of begs the question, if the webapp isn't 
> supposed to start threads of its own in general, what is the 
> "right" way to handle these situations (the most typical 
> being some sort of cron thread, or any need to kick of an 
> asynchronous action)?
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More apps = More load ?

2004-11-12 Thread Steven J. Owens
On Fri, Nov 12, 2004 at 08:47:59AM -0500, Shapira, Yoav wrote:
> No.  I was being general and covering cases where apps launch their own
> threads which do stuff irrespective of whether any users are hitting the
> app or not.  This is a fairly common case, for better or worse. 

 I was discussing this very topic with somebody last night.  This
sort of begs the question, if the webapp isn't supposed to start
threads of its own in general, what is the "right" way to handle these
situations (the most typical being some sort of cron thread, or any need
to kick of an asynchronous action)?

-- 
Steven J. Owens
[EMAIL PROTECTED]

"I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt." - http://darksleep.com/notablog


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: More apps = More load ?

2004-11-12 Thread Shapira, Yoav

Hi,

>But this is all static load, correct? I mean, once Tomcat has started
up

No.  I was being general and covering cases where apps launch their own
threads which do stuff irrespective of whether any users are hitting the
app or not.  This is a fairly common case, for better or worse.  But if
the app doesn't have such threads, then you're right, the load is
incurred once on startup and then you get into a good steady state.

>Finally, even if there is some overall continual performance overhead
for
>having an application loaded, yet unused, how many apps would you have
to
>have to where this overhead would actually be measurable, much less
make
>any
>kind of difference whatsoever in response time to a single specific
app?

That depends on the apps.  It could be one, if it launches 10 different
background tasks, each of which does something costly every second.  Or
it could be 1000 apps if they all just have static content.  Trying to
get a general or magic number answer to this question is pointless,
because the variance in the data set is far too high.  That's why the OP
should spend time stress testing his actual setup.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More apps = More load ?

2004-11-11 Thread Will Hartung
> Hi,
>
> > Does Tomcat use more resources depending on how many apps are present
> > even if they are not being used?
>
> Yes, slightly more for each app, even if it's not used, depending on
> the configuration.
>
> > I would have thought that it was the number of connections to a server
> > and the amount of users/usage there of that would have caused a load
> > which would slow it down.
>
> Typically, this load is indeed the bottleneck, so your thought is right.
> However, if you add many apps, and the load is little, they can become
> the bottleneck as well.  Especially if one or more of the apps does
> processing or uses memory regardless of load (e.g. for pre-caching of
> data on startup).
>
> So as always, it depends on your specific apps and their characteristics.
> It's not hard to create an app that would use app all the server resources
> without any user connecting to it ;)

But this is all static load, correct? I mean, once Tomcat has started up and
all of the applications have performed any initialization, there shouldn't
be hardly any overhead, correct? They'll consume memory, of course.

Certainly there's a level of load if all of the applications are not in
production mode, but even then that should only matter if the applications
are actually USED, correct? Not just loaded? (Specifically thinking about
the run time checking of changed JSPs etc.)

Finally, even if there is some overall continual performance overhead for
having an application loaded, yet unused, how many apps would you have to
have to where this overhead would actually be measurable, much less make any
kind of difference whatsoever in response time to a single specific app?

Regards,

Will Hartung
([EMAIL PROTECTED])



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: More apps = More load ?

2004-11-11 Thread Shapira, Yoav

Hi,

>Does Tomcat use more resources depending on how many apps are present
even
>if they are not being used?

Yes, slightly more for each app, even if it's not used, depending on the
configuration.

>I would have thought that it was the number of connections to a server
and
>the amount of users/usage there of that would have caused a load which
>would slow it down.

Typically, this load is indeed the bottleneck, so your thought is right.
However, if you add many apps, and the load is little, they can become
the bottleneck as well.  Especially if one or more of the apps does
processing or uses memory regardless of load (e.g. for pre-caching of
data on startup).

So as always, it depends on your specific apps and their
characteristics.  It's not hard to create an app that would use app all
the server resources without any user connecting to it ;)

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]