You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Clark, Tom" <to...@compaq.com> on 2000/02/02 00:36:31 UTC

Running multiple servlet instances

Hi,
  I'm trying to run some SingleThreadedModel servets with tomcat and I can't
seem to get more than one instance of each to start up.  I've put multiple
<servlet> ...<\servlet> clauses in my web.xml and they all go thru the
init() method, but when I try to run them with our loadrunner tools, only
one of each class runs the service() method.  The duplicate instances don't
get activated.
  In reading the SingleThreadedModel documents, it talks about having a pool
of servlet instances and running multiple instances for multiple requests,
but I don't see this happening in tomcat.
  Anyone know if this is supposed to work and if so, how to make it happen?
Any help is appreciated.

     thanks,
        Tom Clark

Tom.Clark@Compaq.com

Re: Running multiple servlet instances

Posted by "Craig R. McClanahan" <cm...@mytownnet.com>.
"Clark, Tom" wrote:

> Hi,
>   I'm trying to run some SingleThreadedModel servets with tomcat and I can't
> seem to get more than one instance of each to start up.  I've put multiple
> <servlet> ...<\servlet> clauses in my web.xml and they all go thru the
> init() method, but when I try to run them with our loadrunner tools, only
> one of each class runs the service() method.  The duplicate instances don't
> get activated.
>   In reading the SingleThreadedModel documents, it talks about having a pool
> of servlet instances and running multiple instances for multiple requests,
> but I don't see this happening in tomcat.
>   Anyone know if this is supposed to work and if so, how to make it happen?
> Any help is appreciated.
>

Tomcat does not support multiple instances for SingleThreadModel servlets.
There is no *requirement* that this be provided by a servlet container; the
specification merely *allows* it.

IMHO, SingleThreadModel is a kludge and should have been eliminated from the
specification.  I have no interest in seeing pools implemented in Tomcat and
therefore encouraging people to use a technique that only solves a subset of
the issues regarding multi-threaded servlets.  You are much better off
redesigning your servlets to not rely on SingleThreadModel -- then, there is no
restriction on how many requests the single instance of your servlet can
handle.

>
>      thanks,
>         Tom Clark
>

Craig McClanahan