You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dmitri O.Kondratiev" <do...@gmail.com> on 2009/06/21 21:34:49 UTC

Apache Load Balancer - truncating responses?

Hello!
I have the following problem:
When using apache load balancer with Tomcat, *sometimes* responses get
truncated , resulting in incomplete HTML of *wrong* encoding. My application
that Tomcat runs always returns responses in utf-8, yet when truncated, page
has a different encoding.

The following combinations work:
1) IE -> Tomcat
2) IE -> Load Balancer -> Tomcat
3) WebLoad -> Tomcat

The following returns truncated HTML:
1) WebLoad -> Load Balancer -> Tomcat

Could Apache content negotiation be the reason for this error?
Any other ideas why this could happen?

Thanks!

Dmitri.

RE: Apache Load Balancer - truncating responses?

Posted by Martin Gainty <mg...@hotmail.com>.
i can investigate if you can send me the configuration files you are using for Apache
httpd.conf,workers.properties,.htaccess, mime.types,magic.default

Tribes:
$TRIBES_HOME/org/apache/catalina/tribes/mbeans-descriptors.xml
$TRIBES_HOME/org/apache/catalina/tribes/membership/mbeans-descriptors.xml
$TRIBES_HOME/org/apache/catalina/tribes/transport/mbeans-descriptors.xml
LocalStrings.properties


Mit freundlichen Grüßen
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sun, 21 Jun 2009 23:14:10 +0200
> From: aw@ice-sa.com
> To: users@tomcat.apache.org
> Subject: Re: Apache Load Balancer - truncating responses?
> 
> Dmitri O.Kondratiev wrote:
> > Hello!
> > I have the following problem:
> > When using apache load balancer with Tomcat, *sometimes* responses get
> > truncated , resulting in incomplete HTML of *wrong* encoding. My application
> > that Tomcat runs always returns responses in utf-8, yet when truncated, page
> > has a different encoding.
> > 
> > The following combinations work:
> > 1) IE -> Tomcat
> > 2) IE -> Load Balancer -> Tomcat
> > 3) WebLoad -> Tomcat
> > 
> > The following returns truncated HTML:
> > 1) WebLoad -> Load Balancer -> Tomcat
> > 
> > Could Apache content negotiation be the reason for this error?
> > Any other ideas why this could happen?
> > 
> Hi.
> I can't answer, but just to save time for someone else who would like to 
> help you, could you specify :
> - what platforms is (are) this ?
> - what versions of Apache and Tomcat ?
> - what do you use to connect Apache and Tomcat (mod_proxy_http, 
> mod_proxy_ajp, mod_jk, other ?)
> - is Apache httpd configured to do any kind of caching ?
> - what is "WebLoad" ?
> - what do you mean by "page has a different encoding" ? How do you know 
> that ? Is the HTTP response "Content-type" header different ? Is a 
> <meta> tag in the page different ?
> 
> (If you do not know the answer to that, search in Google for "Fiddler2". 
>   That is an add-on for IE, which allows you to see exactly what 
> requests go from IE -> server, and the responses that go server -> IE. 
> Including the HTTP headers, body etc..).
> 
> Also, to stop you maybe looking in the wrong place, I believe that 
> Apache content negociation only happens when you specify it explicitly, 
> and it should only happen for content that Apache itself can serve 
> locally, not for anything that is proxied somewhere else.
> 
> Also, since according to your data below, it seems to be working fine in 
> Tomcat itself, and not working fine when Apache httpd is in front of it, 
> you may want to post this to the Apache httpd users list.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Re: Apache Load Balancer - truncating responses?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

On 6/22/2009 10:58 AM, André Warnier wrote:
> In the "log.txt", I see that the first browser request is a POST.
> The response to that is a 302 moved, with a new location.
> OK so far.
> But then, when the browser re-issues the request to the new location, it
> does a GET, not a POST.

This is common (client) reaction to a 302 response. Response codes 303
and 307 were invented to standardize the behavior of web browsers that
support such codes. Unfortunately, the fear of older browsers being used
has pretty much kept applications issuing 302 responses instead of the
(better, IMO) 303 and 307 response codes. So, the spec has improved but
the web hasn't so much. :(

Nice analysis of the response, André.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAko/4rkACgkQ9CaO5/Lv0PCkVACgh4PmuOB+JLmG1Emoac3+AKwR
Y0gAnjap23TcScFGxjnevhA++xwetvF8
=b8Ef
-----END PGP SIGNATURE-----

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


Re: Apache Load Balancer - truncating responses?

Posted by André Warnier <aw...@ice-sa.com>.
Hi Dmitri.
No need to copy me personally. I am subscribed to the forum, so I get 
these messages anyway.

A very quick look at the files you posted shows the following thing that 
I personally find strange :

In the "log.txt", I see that the first browser request is a POST.
The response to that is a 302 moved, with a new location.
OK so far.
But then, when the browser re-issues the request to the new location, it 
does a GET, not a POST.

I am not sure this has to do with the issue, but did you try this with 
another browser, and does it do the same ?

Apart from that :
The response seems indeed truncated, after 16632 bytes. The last byte is 
a \xD1, which is invalid UTF-8.
The rest until then is entirely valid UTF-8, also with the correct HTTP 
header :
content-type: text/html;charset=UTF-8

So I think that you do not really have a "wrong encoding" of the 
response.  It is properly encoded.  The fact that it appears wrongly 
encoded is probably just an artifact of IE, who (rightly) never sees the 
proper closing tags of the document, and consequently loses its mind 
somehow.

I have tried to open the saved page with Firefox (after renaming it to 
.html), and it does show an incomplete page, but it shows it in Russian 
(I guess) cyrillic characters.  So it does understand the encoding.

All of that to say that :
- first you should find out about the POST/GET above
- then you should try another browser
- and finally, the problem seems to be indeed a truncation of the 
result.  Now remains to find out why this happens..


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


Re: Apache Load Balancer - truncating responses?

Posted by "Dmitri O.Kondratiev" <do...@gmail.com>.
On Mon, Jun 22, 2009 at 1:14 AM, André Warnier <aw...@ice-sa.com> wrote:

> Dmitri O.Kondratiev wrote:
>
>> Hello!
>> I have the following problem:
>> When using apache load balancer with Tomcat, *sometimes* responses get
>> truncated , resulting in incomplete HTML of *wrong* encoding. My
>> application
>> that Tomcat runs always returns responses in utf-8, yet when truncated,
>> page
>> has a different encoding.
>>
>> The following combinations work:
>> 1) IE -> Tomcat
>> 2) IE -> Load Balancer -> Tomcat
>> 3) WebLoad -> Tomcat
>>
>> The following returns truncated HTML:
>> 1) WebLoad -> Load Balancer -> Tomcat
>>
>> Could Apache content negotiation be the reason for this error?
>> Any other ideas why this could happen?
>>
>>  Hi.
> I can't answer, but just to save time for someone else who would like to
> help you, could you specify :
> - what platforms is (are) this ?
> - what versions of Apache and Tomcat ?
> - what do you use to connect Apache and Tomcat (mod_proxy_http,
> mod_proxy_ajp, mod_jk, other ?)
> - is Apache httpd configured to do any kind of caching ?
> - what is "WebLoad" ?
> - what do you mean by "page has a different encoding" ? How do you know
> that ? Is the HTTP response "Content-type" header different ? Is a <meta>
> tag in the page different ?
>
> (If you do not know the answer to that, search in Google for "Fiddler2".
>  That is an add-on for IE, which allows you to see exactly what requests go
> from IE -> server, and the responses that go server -> IE. Including the
> HTTP headers, body etc..).
>
> Also, to stop you maybe looking in the wrong place, I believe that Apache
> content negociation only happens when you specify it explicitly, and it
> should only happen for content that Apache itself can serve locally, not for
> anything that is proxied somewhere else.
>
> Also, since according to your data below, it seems to be working fine in
> Tomcat itself, and not working fine when Apache httpd is in front of it, you
> may want to post this to the Apache httpd users list.
>
>
>
André and Martin, thanks for trying to help!
Before sending to Tomcat list I asked the same question at Apache httpd
users list. No comments so far :(
As a guideline for load balancing I used an approach outlined here:
http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApache

Some more context on my problem:
- Everything runs on Win32
- apache-tomcat-6.0.18
- Apache2.2
- mod_proxy_balancer
- WebLoad - is used as  load generation tool
http://www.webload.org/

Here is a link<http://rapidshare.com/files/247362496/bad-response-data.zip.html>
to a zip file with:
- brokren response
- appache & tomcat conf
- Packets sniffed by WireShark (with and without balancer)
http://www.wireshark.org/

I will try to provide more data on the problem later.

Thanks!

Re: Apache Load Balancer - truncating responses?

Posted by "Dmitri O.Kondratiev" <do...@gmail.com>.
On Mon, Jun 22, 2009 at 1:14 AM, André Warnier <aw...@ice-sa.com> wrote:

> Dmitri O.Kondratiev wrote:
>
>> Hello!
>> I have the following problem:
>> When using apache load balancer with Tomcat, *sometimes* responses get
>> truncated , resulting in incomplete HTML of *wrong* encoding. My
>> application
>> that Tomcat runs always returns responses in utf-8, yet when truncated,
>> page
>> has a different encoding.
>>
>> The following combinations work:
>> 1) IE -> Tomcat
>> 2) IE -> Load Balancer -> Tomcat
>> 3) WebLoad -> Tomcat
>>
>> The following returns truncated HTML:
>> 1) WebLoad -> Load Balancer -> Tomcat
>>
>> Could Apache content negotiation be the reason for this error?
>> Any other ideas why this could happen?
>>
>>  Hi.
> I can't answer, but just to save time for someone else who would like to
> help you, could you specify :
> - what platforms is (are) this ?
> - what versions of Apache and Tomcat ?
> - what do you use to connect Apache and Tomcat (mod_proxy_http,
> mod_proxy_ajp, mod_jk, other ?)
> - is Apache httpd configured to do any kind of caching ?
> - what is "WebLoad" ?
> - what do you mean by "page has a different encoding" ? How do you know
> that ? Is the HTTP response "Content-type" header different ? Is a <meta>
> tag in the page different ?
>
> (If you do not know the answer to that, search in Google for "Fiddler2".
>  That is an add-on for IE, which allows you to see exactly what requests go
> from IE -> server, and the responses that go server -> IE. Including the
> HTTP headers, body etc..).
>
> Also, to stop you maybe looking in the wrong place, I believe that Apache
> content negociation only happens when you specify it explicitly, and it
> should only happen for content that Apache itself can serve locally, not for
> anything that is proxied somewhere else.
>
> Also, since according to your data below, it seems to be working fine in
> Tomcat itself, and not working fine when Apache httpd is in front of it, you
> may want to post this to the Apache httpd users list.
>
>
>
André and Martin, thanks for trying to help!
Before sending to Tomcat list I asked the same question at Apache httpd
users list. No comments so far :(
As a guideline for load balancing I used an approach outlined here:
http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApache

Some more context on my problem:
- Everything runs on Win32
- apache-tomcat-6.0.18
- Apache2.2
- mod_proxy_balancer
- WebLoad - is used as  load generation tool
http://www.webload.org/

I am attaching a zip file with:
- brokren response
- appache & tomcat conf
- Packets sniffed by WireShark (with and without balancer)
http://www.wireshark.org/

I will try to provide more data on the problem later.

Thanks!

Re: Apache Load Balancer - truncating responses?

Posted by André Warnier <aw...@ice-sa.com>.
Dmitri O.Kondratiev wrote:
> Hello!
> I have the following problem:
> When using apache load balancer with Tomcat, *sometimes* responses get
> truncated , resulting in incomplete HTML of *wrong* encoding. My application
> that Tomcat runs always returns responses in utf-8, yet when truncated, page
> has a different encoding.
> 
> The following combinations work:
> 1) IE -> Tomcat
> 2) IE -> Load Balancer -> Tomcat
> 3) WebLoad -> Tomcat
> 
> The following returns truncated HTML:
> 1) WebLoad -> Load Balancer -> Tomcat
> 
> Could Apache content negotiation be the reason for this error?
> Any other ideas why this could happen?
> 
Hi.
I can't answer, but just to save time for someone else who would like to 
help you, could you specify :
- what platforms is (are) this ?
- what versions of Apache and Tomcat ?
- what do you use to connect Apache and Tomcat (mod_proxy_http, 
mod_proxy_ajp, mod_jk, other ?)
- is Apache httpd configured to do any kind of caching ?
- what is "WebLoad" ?
- what do you mean by "page has a different encoding" ? How do you know 
that ? Is the HTTP response "Content-type" header different ? Is a 
<meta> tag in the page different ?

(If you do not know the answer to that, search in Google for "Fiddler2". 
  That is an add-on for IE, which allows you to see exactly what 
requests go from IE -> server, and the responses that go server -> IE. 
Including the HTTP headers, body etc..).

Also, to stop you maybe looking in the wrong place, I believe that 
Apache content negociation only happens when you specify it explicitly, 
and it should only happen for content that Apache itself can serve 
locally, not for anything that is proxied somewhere else.

Also, since according to your data below, it seems to be working fine in 
Tomcat itself, and not working fine when Apache httpd is in front of it, 
you may want to post this to the Apache httpd users list.


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