[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: Fwd: Very odd behavior with 'cookie' only working intermittently
From:       Chris Patti <cpatti () gazelle ! com>
Date:       2013-06-26 16:10:27
Message-ID: CAMEV-MD0RkQ4BVxYigEAOCBVNmQ4Yr0HR-Kh25L=yS_9HZnJ6Q () mail ! gmail ! com
[Download RAW message or body]

Thank you *VERY* much for this tidbit Nenad.

With the early version of HAProxy we're using (v1.3.18) the actual syntax
is:

option httpclose

This worked perfectly, session afinity started performing as expected.

(Just wanted to record this for posterity)

-Chris



On Fri, Jun 14, 2013 at 5:39 PM, Nenad Merdanovic <nimzo@nimzo.info> wrote:

> Hello Chris,
>
> You are missing one of the options to tell HAproxy to examine every
> request and not just first one for each connection.
>
> Add this to the defaults section:
> option http-server-close (or httpclose/forceclose, whatever suits you)
> timeout http-keep-alive 5s (for example, tune to your needs)
>
> Regards,
> Nenad
>
>
> On 06/14/2013 11:28 PM, Chris Patti wrote:
> > Hello, we have two machines with identical haproxy configurations, set
> > up to load balance each other, with Tomcat on the back end.
> >
> > We're seeing the SERVERID cookie only being set intermittently, despite
> > the fact that as per our understanding it should be set with every
> response.
> >
> > When the cookie is NOT set, the request isn't printed when haproxy is
> > running in debug mode, and the backend "Total Sessions" doesn't
> > increment on the status page.
> >
> > Here's our configuration, we'd sincerely appreciate any hints anyone may
> > have.
> >
> > Thanks,
> > -Chris
> > -----
> > global
> > log 127.0.0.1   local2 info
> > maxconn 4096
> > ulimit-n 8250
> > chroot /home/haproxy
> > user haproxy
> > group haproxy
> > daemon
> > quiet
> > pidfile /home/haproxy/haproxy.pid
> >
> > defaults
> > log     global
> > mode    http
> > option  httplog
> > option  dontlognull
> > retries 3
> > redispatch
> > maxconn 2000
> > contimeout      5000
> > clitimeout      60000
> > srvtimeout      60000
> > stats uri /gz-haproxy-status
> > 120
> > cookie SERVERID insert indirect nocache
> > no option transparent
> >
> >
> > frontend haproxy *:85
> > default_backend tomcat
> >
> > backend tomcat
> >         balance roundrobin
> > option httpchk GET /warehouse/static/images/gazelle_logo_tm.png
> > server stg_wh_1 10.94.246.222:8181 <http://10.94.246.222:8181> cookie
> > i-9b333efb check inter 9000 ri
> > se 2 fall 3 port 8181 maxconn 1000
> > server stg_wh_2 10.223.37.147:8181 <http://10.223.37.147:8181> cookie
> > i-73b5be11 check inter 9000 ri
> > se 2 fall 3 port 8181 maxconn 10
> >
>
> --
> Nenad Merdanovic | PGP: 0x423edcb2 | Web: http://nimzo.info
> Linkedin: http://www.linkedin.com/in/nenadmerdanovic
>

[Attachment #3 (text/html)]

<div dir="ltr">Thank you *VERY* much for this tidbit Nenad.<div><br></div><div \
style>With the early version of HAProxy we&#39;re using (v1.3.18) the actual syntax \
is:</div><div style><br></div><div style>option httpclose</div> <div \
style><br></div><div style>This worked perfectly, session afinity started performing \
as expected.</div><div style><br></div><div style>(Just wanted to record this for \
posterity)</div><div style><br></div><div style>-Chris</div> <div \
style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On \
Fri, Jun 14, 2013 at 5:39 PM, Nenad Merdanovic <span dir="ltr">&lt;<a \
href="mailto:nimzo@nimzo.info" target="_blank">nimzo@nimzo.info</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">Hello Chris,<br> <br>
You are missing one of the options to tell HAproxy to examine every<br>
request and not just first one for each connection.<br>
<br>
Add this to the defaults section:<br>
option http-server-close (or httpclose/forceclose, whatever suits you)<br>
timeout http-keep-alive 5s (for example, tune to your needs)<br>
<br>
Regards,<br>
Nenad<br>
<div><div class="h5"><br>
<br>
On 06/14/2013 11:28 PM, Chris Patti wrote:<br>
&gt; Hello, we have two machines with identical haproxy configurations, set<br>
&gt; up to load balance each other, with Tomcat on the back end.<br>
&gt;<br>
&gt; We&#39;re seeing the SERVERID cookie only being set intermittently, despite<br>
&gt; the fact that as per our understanding it should be set with every response.<br>
&gt;<br>
&gt; When the cookie is NOT set, the request isn&#39;t printed when haproxy is<br>
&gt; running in debug mode, and the backend &quot;Total Sessions&quot; \
doesn&#39;t<br> &gt; increment on the status page.<br>
&gt;<br>
&gt; Here&#39;s our configuration, we&#39;d sincerely appreciate any hints anyone \
may<br> &gt; have.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; -Chris<br>
&gt; -----<br>
&gt; global<br>
&gt; log 127.0.0.1   local2 info<br>
&gt; maxconn 4096<br>
&gt; ulimit-n 8250<br>
&gt; chroot /home/haproxy<br>
&gt; user haproxy<br>
&gt; group haproxy<br>
&gt; daemon<br>
&gt; quiet<br>
&gt; pidfile /home/haproxy/haproxy.pid<br>
&gt;<br>
&gt; defaults<br>
&gt; log     global<br>
&gt; mode    http<br>
&gt; option  httplog<br>
&gt; option  dontlognull<br>
&gt; retries 3<br>
&gt; redispatch<br>
&gt; maxconn 2000<br>
&gt; contimeout      5000<br>
&gt; clitimeout      60000<br>
&gt; srvtimeout      60000<br>
&gt; stats uri /gz-haproxy-status<br>
&gt; 120<br>
&gt; cookie SERVERID insert indirect nocache<br>
&gt; no option transparent<br>
&gt;<br>
&gt;<br>
&gt; frontend haproxy *:85<br>
&gt; default_backend tomcat<br>
&gt;<br>
&gt; backend tomcat<br>
&gt;         balance roundrobin<br>
&gt; option httpchk GET /warehouse/static/images/gazelle_logo_tm.png<br>
</div></div>&gt; server stg_wh_1 <a href="http://10.94.246.222:8181" \
target="_blank">10.94.246.222:8181</a> &lt;<a href="http://10.94.246.222:8181" \
target="_blank">http://10.94.246.222:8181</a>&gt; cookie<br> <div class="im">&gt; \
i-9b333efb check inter 9000 ri<br> &gt; se 2 fall 3 port 8181 maxconn 1000<br>
</div>&gt; server stg_wh_2 <a href="http://10.223.37.147:8181" \
target="_blank">10.223.37.147:8181</a> &lt;<a href="http://10.223.37.147:8181" \
target="_blank">http://10.223.37.147:8181</a>&gt; cookie<br> <div class="HOEnZb"><div \
class="h5">&gt; i-73b5be11 check inter 9000 ri<br> &gt; se 2 fall 3 port 8181 maxconn \
10<br> &gt;<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Nenad Merdanovic | PGP: 0x423edcb2 | Web: <a href="http://nimzo.info" \
                target="_blank">http://nimzo.info</a><br>
Linkedin: <a href="http://www.linkedin.com/in/nenadmerdanovic" \
target="_blank">http://www.linkedin.com/in/nenadmerdanovic</a><br> \
</font></span></blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic