tomcat-users mailing list archives

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

  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.setDateHeader ("Expires", -1); 
    	response.setDateHeader ("Expires", 0);    	


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

  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 ?


Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message