You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Small <ms...@Clickability.com> on 2003/05/12 21:15:35 UTC

SingleThreadModel and maxInstances

I am involved in porting a very large legacy application from JServ to
Tomcat 4.1.18.  This application was written many years ago and was
unfortunately designed around SingleThreadModel. I have considered coverting
it from SingleThreadModel, but I feel that doing so will cause lots of
unneccessary work and will require more testing. In preparation for the
conversion, I have been testing out Tomcat 4.1's STM implementation and have
seen some interesting behaviors. Also I am curious how to set the
maxInstances, do I do it in web.xml in the servlet def?

My servlet is set up to not init on startup. The first time I hit the
servlet it initializes 2 instances. Only the second instance seems to go
into the pool. If I really slam it, it will initialize 8 more instances for
a total of 10 init() calls, but only 9 instances seem to serve requests. My
question is why does it only init 10 instances if the default maxInstances
is 20? Also, what is happing to that first servlet instance, Did it not go
in the pool somehow, I checked out standard wrapper and it looks like this
might be the case, in which case it seems like a bug.

Thanks much.

Here are my logs:

ERROR [12:04:51,473] TestServlet - Servlet init: ID: 0
ERROR [12:04:51,479] TestServlet - Servlet Name: srv
ERROR [12:04:51,480] TestServlet - Servlet Context Name: MyContext
ERROR [12:04:51,521] TestServlet - Servlet init: ID: 1
ERROR [12:04:51,521] TestServlet - Servlet Name: srv
ERROR [12:04:51,522] TestServlet - Servlet Context Name: MyContext
ERROR [12:04:51,534] TestServlet - Start doGet. ID: 1
ERROR [12:05:01,538] TestServlet - End   doGet. ID: 1
ERROR [12:05:14,313] TestServlet - Start doGet. ID: 1
ERROR [12:05:24,321] TestServlet - End   doGet. ID: 1
ERROR [12:11:48,705] TestServlet - Start doGet. ID: 1
ERROR [12:11:48,719] TestServlet - Servlet init: ID: 2
ERROR [12:11:48,720] TestServlet - Servlet Name: srv
ERROR [12:11:48,720] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:48,720] TestServlet - Start doGet. ID: 2
ERROR [12:11:48,856] TestServlet - Servlet init: ID: 3
ERROR [12:11:48,856] TestServlet - Servlet Name: srv
ERROR [12:11:48,857] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:48,857] TestServlet - Start doGet. ID: 3
ERROR [12:11:49,193] TestServlet - Servlet init: ID: 4
ERROR [12:11:49,194] TestServlet - Servlet Name: srv
ERROR [12:11:49,194] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,195] TestServlet - Start doGet. ID: 4
ERROR [12:11:49,229] TestServlet - Servlet init: ID: 5
ERROR [12:11:49,229] TestServlet - Servlet Name: srv
ERROR [12:11:49,230] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,231] TestServlet - Start doGet. ID: 5
ERROR [12:11:49,382] TestServlet - Servlet init: ID: 6
ERROR [12:11:49,383] TestServlet - Servlet Name: srv
ERROR [12:11:49,383] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,384] TestServlet - Start doGet. ID: 6
ERROR [12:11:49,552] TestServlet - Servlet init: ID: 7
ERROR [12:11:49,552] TestServlet - Servlet Name: srv
ERROR [12:11:49,553] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,553] TestServlet - Start doGet. ID: 7
ERROR [12:11:49,737] TestServlet - Servlet init: ID: 8
ERROR [12:11:49,737] TestServlet - Servlet Name: srv
ERROR [12:11:49,738] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,738] TestServlet - Start doGet. ID: 8
ERROR [12:11:49,908] TestServlet - Servlet init: ID: 9
ERROR [12:11:49,908] TestServlet - Servlet Name: srv
ERROR [12:11:49,908] TestServlet - Servlet Context Name: MyContext
ERROR [12:11:49,909] TestServlet - Start doGet. ID: 9
ERROR [12:11:58,713] TestServlet - End   doGet. ID: 1
ERROR [12:11:58,723] TestServlet - End   doGet. ID: 2
ERROR [12:11:58,737] TestServlet - Start doGet. ID: 2
ERROR [12:11:58,748] TestServlet - Start doGet. ID: 1
ERROR [12:11:58,862] TestServlet - End   doGet. ID: 3
ERROR [12:11:58,877] TestServlet - Start doGet. ID: 3
ERROR [12:11:59,202] TestServlet - End   doGet. ID: 4
ERROR [12:11:59,217] TestServlet - Start doGet. ID: 4
ERROR [12:11:59,232] TestServlet - End   doGet. ID: 5
ERROR [12:11:59,248] TestServlet - Start doGet. ID: 5
ERROR [12:11:59,392] TestServlet - End   doGet. ID: 6
ERROR [12:11:59,406] TestServlet - Start doGet. ID: 6
ERROR [12:11:59,562] TestServlet - End   doGet. ID: 7
ERROR [12:11:59,576] TestServlet - Start doGet. ID: 7
ERROR [12:11:59,742] TestServlet - End   doGet. ID: 8
ERROR [12:11:59,757] TestServlet - Start doGet. ID: 8
ERROR [12:11:59,912] TestServlet - End   doGet. ID: 9
ERROR [12:12:08,743] TestServlet - End   doGet. ID: 2
ERROR [12:12:08,753] TestServlet - End   doGet. ID: 1
ERROR [12:12:08,883] TestServlet - End   doGet. ID: 3
ERROR [12:12:09,223] TestServlet - End   doGet. ID: 4
ERROR [12:12:09,253] TestServlet - End   doGet. ID: 5
ERROR [12:12:09,413] TestServlet - End   doGet. ID: 6
ERROR [12:12:09,583] TestServlet - End   doGet. ID: 7
ERROR [12:12:09,764] TestServlet - End   doGet. ID: 8

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org