tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danilo Luiz Rheinheimer <danilo...@yahoo.com>
Subject Performace - long time to release connection
Date Wed, 16 Apr 2008 15:33:29 GMT
Hi,

  I have a Java application running on a Tomcat server
(last version of the 5.5 serie). Java version is 6.
  I have a servlet inside this application who returns
json to the browser (if you do not know json it is
just a text). 
  This process it taking a very long time, something
like  10 seconds.
  I put some simple debug code inside my servlet to
show how much time the servlet takes to process it.
The time is short like 0.5 seconds. 
  Still to the browser it takes 10 seconds !
  If I type the servlet url on the browser I can see
it returns the result fast (the json shows on the
browser screen after 0.5 seconds). 
  But it do not release the http connection to the
server. It keeps the message 'receiving data from ...'
on the botton of the browser for almost 10 seconds.
  There are not a big load on the server at the moment
of this tests. In fact it is only me.

  The resumed servlet code is something like this :

    	response.setHeader("Cache-Control","no-cache"); 
    	response.setHeader("Pragma","no-cache"); 
    	response.setDateHeader ("Expires", -1); 
    	response.setHeader("Cache-Control","no-store"); 
    	response.setDateHeader ("Expires", 0);    	

        response.setContentType("text/html");

        String s = ... // creates JSON String
        PrintWriter w = response.getWriter();
        w.write(s);

  As you can see very standard I think. 
  I have the no cache headers because the json is
generated at every time and can not be cahed. 

  Someone has any idea of what the problem is ?

Danilo.


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

---------------------------------------------------------------------
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


Mime
View raw message