Gary Albers@TIMEWEB
04/17/2000 01:14 PM
Not creating an instance variable makes sense.
But how would you do that in a JSP anyway?
It appears that all the variables I declare in JSP via <%! ... %> become
variables
defined in the method _jspService.
So how do you declare an instance variable in JSP such that it's scope
allows
it to be used simultaneously my multiple threads? (because I definitely
want to avoid it).
-Gary
"Magnus Stenman" <[EMAIL PROTECTED]> on 04/17/2000 09:59:18 AM
To: Orion-Interest <[EMAIL PROTECTED]>
cc: (bcc: Gary Albers/DDI)
Subject: Re: JSP Problems during load testing.
Hi, if your JSP page isnt thread-safe then use:
<%@ page isThreadSafe="false %>, but we strongly recommend against that.
The better solution is to make your JSP thread-safe instead (non
thread-safe
will scale horribly bad) -
are you using any instance vars? (if so, why?)
Try not to use instance vars in JSP pages and servlets, a better solution
is
an object created at the start of the method holding all the vars (usually,
that is).
Hope it helps, if there's any more q's feel free to ask. :)
/Magnus Stenman, the Orion team
----- Original Message -----
From: "Taylor, Julian (NOW)" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Monday, April 17, 2000 12:59 PM
Subject: JSP Problems during load testing.
>
> Hello all,
>
> I have been load testing my current system and have noticed a significant
> problem with my main JSP page.
> This page:
>
> 1) looks up EJBs 1 entity, 1 session
> 2) The entity bean is looked up and returns correct data
> 3) Session bean is slower, having to do some rendering/parsing of
returned
> content
> 4) The JSP accesses this rendering bean before actually using the
variables
> set from the entity bean.
>
> Test situation:
> 1) Load test performed on this page using a specific News-ID to perform
> lookups.
> 2) When accessing this JSP page with a different News-ID the JSP renders
> mixed content back to me, ie. the News-Title is being reset with a new
value
> (the value of the page being load tested) before the response has been
> written :(
>
> I think the JSP servlet instance handling this request is handling
another
> request before finishing writing the response out to the existing
request.
> Would this be true? - if so are there any ways to configure the server
so
> this does not under any circumstances happen?
> If not this is a potential bug in the servlet / JSP engine.
> When using Apache-JServ for example the user can specify the size of the
> servlet instance pool.
>
> I am worried at this point as this behavior occurs at a relatively low
load
> ~15-20 page views / second.
> At higher loads I get null-pointer exceptions being thrown as the JSP
gets
> its knickers in a pretty severe twist.
>
> This is the first time I have had to write in. I am using 0.9.6, and
think
> as others do that over-all this is a very cool piece of software and have
up
> till now not had any other problems with it.
>
> Regards
>
> Jools