You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2001/07/31 15:21:11 UTC

RE: How to ensure Tomcat to load multiple instances of a servlet, to handle simultaneously multiple request ?

	This is most definitely a problem with either your database or your
database access architecture.  Tomcat, using one servlet instance, can
handles hundred and even thousands of concurrent requests - each request
runs in a thread that executes the appropriate method of the servlet.

	I would look at your database architecture, possibly your JDBC
drivers - even Access allows you to do multiple things at once (even though
you are shooting yourself in the foot as you do so).  Is there any code in
there that is synchronized or in some other manner queued to allow only one
request at a time?  Also, you might want to look into your database's
locking methodology - the long query might be getting locks on the tables
that the quicker one wants, thus causing the wait.

	Randy

> -----Original Message-----
> From: Jim Rueschhoff [mailto:jrueschhoff@imsurenetwork.com]
> Sent: Tuesday, July 31, 2001 9:43 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: How to ensure Tomcat to load multiple instances of a
> servlet, to handle simultaneously multiple request ?
> 
> 
> What database are you using?  This type of behavior is 
> frequently associated
> with people trying to use Access as a database for a website. 
>  A database
> designed for use in a multiuser multithread environment 
> should not have this
> problem.  The problem is a database problem, not a JSP problem, in my
> opinion.
> 
> 
> 
> -----Original Message-----
> From: Hariharasubramanian Ranganathan [mailto:harir@kumaran.com]
> Sent: Tuesday, July 31, 2001 3:14 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: How to ensure Tomcat to load multiple instances of a
> servlet, to handle simultaneously multiple request ?
> 
> 
> > - the Servlet implements SinglethreadModel,
> 
> Donot implement SingleThreadedModel interface which synchronizes the
> servlet.
> 
> Hari
> 
> 
> ----- Original Message -----
> From: "grégoire nogier" <no...@free.fr>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, July 31, 2001 3:11 PM
> Subject: How to ensure Tomcat to load multiple instances of a 
> servlet, to
> handle simultaneously multiple request ?
> 
> 
> > How to ensure Tomcat to load multiple instances of a 
> servlet, to handle
> > simultaneously multiple request ?
> >
> > I'v developed a servlet application in tomcat/apache, on NT.
> > I tried a very simple load test :
> >    - 1) from a first pc, I send a request which neeed a 
> very long database
> > access (3 minutes),
> >    - 2) from another pc, I send a very simple request 
> (which should be
> > traited immediately)
> >    => the result is that the second request wait 3 minutes before
> receiving
> > its response. The requests are served the one after the other.
> >
> > I'm not sure to understand how tomcat works, but I imagined 
> that it should
> > be possible to load multiple servlet process, to handle 20 request
> > simultaneously.
> > It seems not.
> >
> > - should I duplicate the servlet in the file web.xml ?
> > - should I duplicate the servlet context ?
> > - should I define more workers ? (how to ?)
> > - should I use some other connector, or RequestInterceptor ?
> >
> > Here is a short description of the configuration used :
> > - tomcat-v3.2.2, apache-v1.3
> > - the Servlet implements SinglethreadModel,
> > - the file : mod_jk.conf mount the servlet-path with the 
> ajp13 worker,
> > - the file : server.xml defines a PoolTcpConnector 
> Ajp13ConnectionHandler
> > (parameters are: max_threads=50, max_spare_threads=25,
> > min_spare_threads=10),
> > - the file : workers.properties defines two workers
> > (worker.list=ajp13,loadbalancer)
> > - the file : web.xml defines two servlet (only one seems to 
> be used...)
> >
> > I need some help !
> >
> > Gregoire Nogier
> >
> >
>