Daniel,

So far I've just been running it on a test-platform using just the default
web-application. I haven't defined any additional names for it. However,
Richard Wu's mail where he pasted this from the spec: "For a servlet not
implementing SingleThreadModel and not hosted in a distributed environment
(the default), " got me thinking that as we have our servers configured to
run in a cluster would that affect this ?

And indeed this is a bit of a problem, like in our case the
request-controller reads and caches the page-information from the db, now if
I want to refresh the cache without restarting the server I can't control
which instance of the servlet will get refreshed ..

----- Original Message -----
From: "Daniel López" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 10:04 AM
Subject: Re: multiple instances of a servlet?


> Hi Ville,
>
> Do you, by any chance, have different names defined for your controller
> servlet in the web.xml file? I also have my own ControllerServlet
> framework and I just have a single instance, unless I define more than
> one name for the same servlet. If you define different web applications
> you would also have different instances, even if you use the same name,
> so have a look at your web.xml files to see if the problem is in there.
> Just my 2ec,
> D.
>
>
> Ville Rinne wrote:
> >
> > Kevin, let me know how your tests came out. I did some more testing
myself
> > and I found it strange that when I created a specific simple
test-servlet
> > for this case I didn't manage to get more than one instance of it
created.
> > I'll do some more testing tomorrow but there is definitely something
> > strange going on. Obviously the amount my testservlet takes to complete
a
> > request is smaller than the amount of time my request-controller takes
but
> > at this point I honestly don't have a clue :P
> >
> > Anyhow, since servlets aren't synchronized in any way by default, how
> > would it increase performance even if there was more than one instance
of
> > them in existance?
> >
> > cheers,
> > Ville Rinne
> >
> > Of course it isn't a huge problem
> >
> > On Tue, 7 Aug 2001, Duffey, Kevin wrote:
> >
> > > Keep in mind that every app server is allowed to implement the spec in
their
> > > own manner. It does sound peculiar, but it is very possible that Orion
gets
> > > its performance by pooling a few servlet instances even without the
single
> > > threaded model. I don't know for sure, but that seems logical. By
having
> > > even two or three instances, it could increase the ability to handle
ore
> > > requests..although myself I thought that a single instance would be
plenty
> > > fast to have literally thousands of requests per second hit it. Each
time a
> > > request comes in, the container should create a new thread for that
request
> > > then send it on its way to the servlet instance. A PIII600 system can
run
> > > over 1billion instructions per second. Figure that with the JVM
interpreter,
> > > your code and any resources, you should still be able to iterate
thousands
> > > of requests per second, unless object creation in a servlet (and
depending
> > > on what it is doing) slows things down. The one factor I am not sure
of is
> > > how many "threads" a JVM can handle at one time. I have heard of
single
> > > servers handling 1000's of hits per second, and if each request goes
to a
> > > JSP or servlet, that should equate to one new thread per request..even
if
> > > the session id is the same (for example, the user somehow opened a new
> > > window from the browser window..and could possibly submit two (or
more)
> > > requests at the same time).
> > >
> > > At any rate, it sounds to me like perhaps either there is a bug, or
that
> > > Orion is doing this pooling automatically to increase performance.
> > > Interesting though..I will now check out to see if my MVC framework
does the
> > > same thing.
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Ville Rinne [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, August 07, 2001 7:59 AM
> > > To: Orion-Interest
> > > Subject: multiple instances of a servlet?
> > >
> > >
> > > We've implemented the request-controller pattern using a servlet as
the
> > > entry-point of all our jsp-pages. For some reason Orion creates
multiple
> > > instances of this servlet even though it isn't implementing
> > > SingleThreadModel and there isn't anything peculiar about it. I have
the
> > > servlet printing to System.out every time init() is run and every time
it
> > > receives a request, it also prints the memory address of the instance
that's
> > > handling it. For some reason with this servlet there are multiple
instances
> > > (up to 3 so far) that handle these requests. There doesn't seem to be
any
> > > larger logic in which instance gets to handle the request. It's not a
> > > problem per se but I just find it rather strange since I assumed that
only
> > > one instance of a servlet would be created. Anyone else ran into this
?
> > >
> > > cheers,
> > > Ville Rinne
>


Reply via email to