Bug 37627 - Slow and incomplete dynamic content generation after enabling native connector support
Slow and incomplete dynamic content generation after enabling native connecto...
Product: Tomcat Native
Classification: Unclassified
Component: Library
Other Linux
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2005-11-24 14:03 UTC by Eric Jain
Modified: 2009-06-12 16:34 UTC (History)
0 users

Test application (361.54 KB, application/octet-stream)
2005-11-24 14:04 UTC, Eric Jain

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jain 2005-11-24 14:03:58 UTC
After adding the APR library to the java.library.path [as described in
http://tomcat.apache.org/tomcat-5.5-doc/apr.html], certain JSPs that produce a
lot of output (but used to be served in under a second) are now very slow and
produce incomplete output (after reloading a few times). Sometimes the header
appears only after a few kilobytes of output, at which point the output is cut

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
Server: Apache-Coyote/1.1
X-Total-Results: 389
Content-Type: text/html;charset=UTF-8
Content-Language: en-US
Content-Length: 22858
Date: Thu, 24 Nov 2005 08:41:56 GMT

Any ideas what is going on here?
Comment 1 Eric Jain 2005-11-24 14:04:50 UTC
Created attachment 17031 [details]
Test application
Comment 2 Remy Maucherat 2005-11-24 14:19:43 UTC
Nope, this JSP works fine for me. Another attempt ?
Comment 3 Remy Maucherat 2005-11-24 15:07:46 UTC
A bad bug report ... The header returned gave away you were using a large
bufferSize (which BTW I consider an inefficient waste of memory), however.
Comment 4 Eric Jain 2005-11-24 15:25:12 UTC
I am using a Tomcat 5.5.12 default installation, and never set any "bufferSize"
anywhere!? Do I need to change the default value?
Comment 5 Eric Jain 2005-11-24 15:27:23 UTC
It seems that the problem can't be reproduced on Windows. Perhaps I did
something wrong during setup? I have apr-1.2.2 installed.
Comment 6 Remy Maucherat 2005-11-24 15:41:44 UTC
(In reply to comment #4)
> I am using a Tomcat 5.5.12 default installation, and never set any "bufferSize"
> anywhere!? Do I need to change the default value?

Content-Length: 22858 proves you are using response.setBufferSize.
Comment 7 Eric Jain 2005-11-24 16:00:20 UTC
(In reply to comment #6)
> Content-Length: 22858 proves you are using response.setBufferSize.

Please have a look at the attached test application; it's a simple jsp page, no
response.setBufferSize in sight!
Comment 8 Eric Jain 2006-02-24 01:09:18 UTC
Looks like this is still an issue with 5.5.15. Here is a further observation:
The problem doesn't occur when connecting from the same machine, but only when
connecting from a remote machine (tested Windows to Linux).

Sample telnet session:

GET /test/test.jspx HTTP/1.0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xhtml+xml;charset=UTF-8
Date: Thu, 23 Feb 2006 23:56:37 GMT
Connection: close

[snipped lots of data]
This is a

Connection to host lost.

I've added autoFlush="true" and buffer="8kb" to the jsp:directive.page element
(though I believe that's the default anyway), no effect.

If someone can confirm that the same test page can be retrieved fine from their
own installation (remotely), I'll try to dig deeper...
Comment 9 konkow 2006-11-16 00:59:56 UTC
I have the same effect. Sometimes page is not loaded completely. Sometimes the
same pages are loaded twice, means: Page is delivered let's say for 70% and then
the complete response-content is delivered another time in the page. Effect:
Double Response in page. 

Number of characters until the response is repeated(in my example case): 204613.
The page is utf-8. Other cases were 221656, ...
----- Snip ------------





----- Snap ------------

We have a JSF/Hibernate application. 
Our environment: Linux(don't get the effect on windows); on Linux we have
AJP/1.3 and apr1.2.2; tomcat version 5.5.20;

Unfortunately the behaviour in our case is nondeterministic. :-( Seems to depend
on loading time of jsp. The bigger the page the higher the possibility to get
the strange behaviour.
Comment 10 Mladen Turk 2006-11-16 09:34:41 UTC
Tested with:

Apache Tomcat 5.5.20/tomcat-native-1.1.7
Linux dev17.qa.atl.jboss.com 2.6.9-42.0.2.ELsmp #1 SMP Thu Aug 17 17:57:31 EDT
2006 x86_64 x86_64 x86_64 GNU/Linux

Client Windows XP over OpenVPN
Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet> set logfile C:\telnet.log
Log file : C:\telnet.log
Client logging on
Microsoft Telnet> o dev17 10080
GET /tomcat-bug/index.jspx HTTP/1.0

logfile contains:
GET /tomcat-bug/index.jspx HTTP/1.0
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=33BDEE522FC7C10FA33839458369DDB6; Path=/tomcat-bug
Content-Type: application/xhtml+xml;charset=UTF-8
Date: Thu, 16 Nov 2006 17:28:12 GMT
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
                                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1
.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                                                                   <html xmlns="
http://www.w3.org/1999/xhtml"><head><title>Test</title></head><body><p>This is a


98</li><li>This is a list item 999</li><li>This is a list item 1000</li></ul></b

So everything works just fine.
Please test with the Tomcat 5.5.20 and Tomcat-Native 1.1.7
Comment 11 konkow 2006-11-19 23:17:23 UTC
As recommended we have tested things with Tomcat 5.5.20, Tomcat-Native 1.1.7 and
also updated apr to 1.2.7. 
Unfortunately things are NOT resolved. We still got the strange behaviour as
described below. For getting things working we are running currently without
native support: no problems so far...
If there are any magic options for getting debug information you need, let me know.
Comment 12 Mark Thomas 2009-01-05 16:01:11 UTC
Given the trouble we have had re-producing this, could you test with 5.5.27 and tc-native 1.1.16 in case one of the many fixes since 5.5.20 and 1.1.7 has fixed this.
Comment 13 Mark Thomas 2009-06-12 16:34:19 UTC
Given the lack of activity, I am going to assume that this has been fixed in later tcnative versions. It certainly sounds like some of the issues seen in earlier releases.

As always, if you still see this issue with the latest stable releases then please re-open and provide the steps to reproduce.