You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mehdi Sarmadi <ms...@gmail.com> on 2012/04/12 10:25:57 UTC

Problem with making HTTP KeepAlive work

Hi

  I just setup a tomcat 7 on linux for test. I just used this connection
property in server.xml

here is out connector
<Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
allowTrace="false" connectionTimeout="20000" clientAuth="false" />

, but when we try to connect from a client "Firefox" in my case,
"Connection: Keep-Alive" is sent in the Request by Browser but "Connection:
Keep-Alive" is not visible in the HTTP Response Headers, which obviously
coming from weblogic. I use HTTPFox plugin.

  So I guess that  that config does not work. Something seems to be missing.
  Any suggestion for making HTTP KeepAlive work in Tomcat?

Looking forward to your replies
Cheers

--
Mehdi Sarmadi

Re: Problem with making HTTP KeepAlive work

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
> you'r right just fixed it.
>
> <Connector maxKeepAliveRequests="50000" port="7070" protocol="HTTP/1.1"
> allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>
> anyway, I can't still find the "Connection: Keep-Alive" HTTP Response(from
> tomcat) header. I just don't know where to check, any clues? anything
> missing?
>
>
> On Thu, Apr 12, 2012 at 5:28 PM, Konstantin Kolinko
> <kn...@gmail.com>wrote:
>
>> 2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
>> >
>> >  I just setup a tomcat 7 on linux for test. I just used this connection
>> > property in server.xml
>> >
>> > here is out connector
>> > <Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
>> > allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>> >
>> > , but when we try to connect from a client "Firefox" in my case,
>> > "Connection: Keep-Alive" is sent in the Request by Browser but
>> "Connection:
>> > Keep-Alive" is not visible in the HTTP Response Headers, which obviously
>> > coming from weblogic. I use HTTPFox plugin.
>> >
>> >  So I guess that  that config does not work. Something seems to be
>> missing.
>> >  Any suggestion for making HTTP KeepAlive work in Tomcat?
>> >
>>
>> Connection: Keep-Alive  header has different meaning.
>>
>> It is needed only when you have Keep-Alive: header as well so that
>> "Keep-Alive" header value is not lost at proxies.
>>
>> Keep alive feature of HTTP/1.1 does not need to be specified in the
>> response. It is "on" by default. See RFC2616 aka HTTP/1.1
>> specification.
>>
>>

1. I already answered why you cannot find it.
2. Post replies below the text that you are relying to.

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


Re: Problem with making HTTP KeepAlive work

Posted by Mehdi Sarmadi <ms...@gmail.com>.
I just misunderstood, so you'r saying it is HTTP 1.0 we will have the
keep-alive in HTTP?
I'll check that.
--
Mehdi Sarmadi


On Thu, Apr 12, 2012 at 5:36 PM, Mehdi Sarmadi <ms...@gmail.com> wrote:

> you'r right just fixed it.
>
> <Connector maxKeepAliveRequests="50000" port="7070" protocol="HTTP/1.1"
> allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>
> anyway, I can't still find the "Connection: Keep-Alive" HTTP Response(from
> tomcat) header. I just don't know where to check, any clues? anything
> missing?
>
> --
> Mehdi Sarmadi
>
>
>
> On Thu, Apr 12, 2012 at 5:28 PM, Konstantin Kolinko <
> knst.kolinko@gmail.com> wrote:
>
>> 2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
>> >
>> >  I just setup a tomcat 7 on linux for test. I just used this connection
>> > property in server.xml
>> >
>> > here is out connector
>> > <Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
>> > allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>> >
>> > , but when we try to connect from a client "Firefox" in my case,
>> > "Connection: Keep-Alive" is sent in the Request by Browser but
>> "Connection:
>> > Keep-Alive" is not visible in the HTTP Response Headers, which obviously
>> > coming from weblogic. I use HTTPFox plugin.
>> >
>> >  So I guess that  that config does not work. Something seems to be
>> missing.
>> >  Any suggestion for making HTTP KeepAlive work in Tomcat?
>> >
>>
>> Connection: Keep-Alive  header has different meaning.
>>
>> It is needed only when you have Keep-Alive: header as well so that
>> "Keep-Alive" header value is not lost at proxies.
>>
>> Keep alive feature of HTTP/1.1 does not need to be specified in the
>> response. It is "on" by default. See RFC2616 aka HTTP/1.1
>> specification.
>>
>>
>> By the way:
>> 1. You are missing quotes around "-1". The above is broken XML.
>> 2. You will get the same response even if you remove the
>> maxKeepAliveRequests attribute.
>>
>> Best regards,
>> Konstantin Kolinko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Problem with making HTTP KeepAlive work

Posted by Mehdi Sarmadi <ms...@gmail.com>.
Assuming keep-alive being on by default in HTTP/1.1 how come, apache does
not work that way?
I mean even I force HTTP/1.1 in apache with Keep-Alive On, it sends back
"Connection: KeepAlive" in HTTP Response?
Moreover, turning keepalive feature on, makes Apache response about 8 to 10
times more than the time it is not On, but tomcat does not behave the same
and I can't see Improvements in number of concurrent sessions.
--
Mehdi Sarmadi


On Thu, Apr 12, 2012 at 5:36 PM, Mehdi Sarmadi <ms...@gmail.com> wrote:

> you'r right just fixed it.
>
> <Connector maxKeepAliveRequests="50000" port="7070" protocol="HTTP/1.1"
> allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>
> anyway, I can't still find the "Connection: Keep-Alive" HTTP Response(from
> tomcat) header. I just don't know where to check, any clues? anything
> missing?
>
> --
> Mehdi Sarmadi
>
>
>
> On Thu, Apr 12, 2012 at 5:28 PM, Konstantin Kolinko <
> knst.kolinko@gmail.com> wrote:
>
>> 2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
>> >
>> >  I just setup a tomcat 7 on linux for test. I just used this connection
>> > property in server.xml
>> >
>> > here is out connector
>> > <Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
>> > allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>> >
>> > , but when we try to connect from a client "Firefox" in my case,
>> > "Connection: Keep-Alive" is sent in the Request by Browser but
>> "Connection:
>> > Keep-Alive" is not visible in the HTTP Response Headers, which obviously
>> > coming from weblogic. I use HTTPFox plugin.
>> >
>> >  So I guess that  that config does not work. Something seems to be
>> missing.
>> >  Any suggestion for making HTTP KeepAlive work in Tomcat?
>> >
>>
>> Connection: Keep-Alive  header has different meaning.
>>
>> It is needed only when you have Keep-Alive: header as well so that
>> "Keep-Alive" header value is not lost at proxies.
>>
>> Keep alive feature of HTTP/1.1 does not need to be specified in the
>> response. It is "on" by default. See RFC2616 aka HTTP/1.1
>> specification.
>>
>>
>> By the way:
>> 1. You are missing quotes around "-1". The above is broken XML.
>> 2. You will get the same response even if you remove the
>> maxKeepAliveRequests attribute.
>>
>> Best regards,
>> Konstantin Kolinko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Problem with making HTTP KeepAlive work

Posted by Mehdi Sarmadi <ms...@gmail.com>.
you'r right just fixed it.

<Connector maxKeepAliveRequests="50000" port="7070" protocol="HTTP/1.1"
allowTrace="false" connectionTimeout="20000" clientAuth="false" />

anyway, I can't still find the "Connection: Keep-Alive" HTTP Response(from
tomcat) header. I just don't know where to check, any clues? anything
missing?

--
Mehdi Sarmadi


On Thu, Apr 12, 2012 at 5:28 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
> >
> >  I just setup a tomcat 7 on linux for test. I just used this connection
> > property in server.xml
> >
> > here is out connector
> > <Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
> > allowTrace="false" connectionTimeout="20000" clientAuth="false" />
> >
> > , but when we try to connect from a client "Firefox" in my case,
> > "Connection: Keep-Alive" is sent in the Request by Browser but
> "Connection:
> > Keep-Alive" is not visible in the HTTP Response Headers, which obviously
> > coming from weblogic. I use HTTPFox plugin.
> >
> >  So I guess that  that config does not work. Something seems to be
> missing.
> >  Any suggestion for making HTTP KeepAlive work in Tomcat?
> >
>
> Connection: Keep-Alive  header has different meaning.
>
> It is needed only when you have Keep-Alive: header as well so that
> "Keep-Alive" header value is not lost at proxies.
>
> Keep alive feature of HTTP/1.1 does not need to be specified in the
> response. It is "on" by default. See RFC2616 aka HTTP/1.1
> specification.
>
>
> By the way:
> 1. You are missing quotes around "-1". The above is broken XML.
> 2. You will get the same response even if you remove the
> maxKeepAliveRequests attribute.
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Problem with making HTTP KeepAlive work

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/4/12 Mehdi Sarmadi <ms...@gmail.com>:
>
>  I just setup a tomcat 7 on linux for test. I just used this connection
> property in server.xml
>
> here is out connector
> <Connector maxKeepAliveRequests=-1 port="7070" protocol="HTTP/1.1"
> allowTrace="false" connectionTimeout="20000" clientAuth="false" />
>
> , but when we try to connect from a client "Firefox" in my case,
> "Connection: Keep-Alive" is sent in the Request by Browser but "Connection:
> Keep-Alive" is not visible in the HTTP Response Headers, which obviously
> coming from weblogic. I use HTTPFox plugin.
>
>  So I guess that  that config does not work. Something seems to be missing.
>  Any suggestion for making HTTP KeepAlive work in Tomcat?
>

Connection: Keep-Alive  header has different meaning.

It is needed only when you have Keep-Alive: header as well so that
"Keep-Alive" header value is not lost at proxies.

Keep alive feature of HTTP/1.1 does not need to be specified in the
response. It is "on" by default. See RFC2616 aka HTTP/1.1
specification.


By the way:
1. You are missing quotes around "-1". The above is broken XML.
2. You will get the same response even if you remove the
maxKeepAliveRequests attribute.

Best regards,
Konstantin Kolinko

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