You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jun Zhang <er...@cs.ubc.ca> on 2007/11/20 23:39:52 UTC

Questions about sometime slowness of tomcat

Hi,

I really do not know which mail alias is the correct one to post this
topic. So I send it to all.

I am developing a web application using Tomcat, which uses a servlet to
handle the request, which includes geting data from database and writing
the data back to the client to display. When I restart the tomcat and
begin this process, then the time would be 750ms for one request to get
response. However when the client sends the request after the tomcat
finish some requests, then the time would become about 200ms.

I do not know why. I have exclude the affect of database. You know I do
not know the working mechanism of tomcat. So if someone here could help
me explain why and if there is some way to avoid it.

Thanks a lot,

Jun


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


Re: Questions about sometime slowness of tomcat

Posted by david delbecq <de...@oma.be>.
First request is slower to respond to client becaus tomcat do have to
initialize your servlet before first request and, probably, to compile
your jsp

Jun Zhang a écrit :
> Hi,
>
> I really do not know which mail alias is the correct one to post this
> topic. So I send it to all.
>
> I am developing a web application using Tomcat, which uses a servlet to
> handle the request, which includes geting data from database and writing
> the data back to the client to display. When I restart the tomcat and
> begin this process, then the time would be 750ms for one request to get
> response. However when the client sends the request after the tomcat
> finish some requests, then the time would become about 200ms.
>
> I do not know why. I have exclude the affect of database. You know I do
> not know the working mechanism of tomcat. So if someone here could help
> me explain why and if there is some way to avoid it.
>
> Thanks a lot,
>
> Jun
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Questions about sometime slowness of tomcat

Posted by Tony Anecito <ad...@yahoo.com>.
Hi Jun,

This could be due to several factors. I see this alot
in SOAP calls where the first request is signficanly
longer than susequent requests. It could be the jvm is
optimizing the code and after multiple passes through
the code it runs faster. It could also be there are
objects that get created and the first time it takes
longer than the susequent times especially if you use
JSP's and do not compile them first at server startup.

That is why when making performance measurements you
need to take many measurements of the same request to
get the optimal response and make measurements of of a
mixure of different types of requests to get a more
accurate picture.

Regards,
-Tony


--- Jun Zhang <er...@cs.ubc.ca> wrote:

> Hi,
> 
> I really do not know which mail alias is the correct
> one to post this
> topic. So I send it to all.
> 
> I am developing a web application using Tomcat,
> which uses a servlet to
> handle the request, which includes geting data from
> database and writing
> the data back to the client to display. When I
> restart the tomcat and
> begin this process, then the time would be 750ms for
> one request to get
> response. However when the client sends the request
> after the tomcat
> finish some requests, then the time would become
> about 200ms.
> 
> I do not know why. I have exclude the affect of
> database. You know I do
> not know the working mechanism of tomcat. So if
> someone here could help
> me explain why and if there is some way to avoid it.
> 
> Thanks a lot,
> 
> Jun
> 
> 
>
---------------------------------------------------------------------
> To start a new topic, e-mail:
> users@tomcat.apache.org
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org