[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'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"><<a \
href="mailto:nimzo@nimzo.info" target="_blank">nimzo@nimzo.info</a>></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>
> Hello, we have two machines with identical haproxy configurations, set<br>
> up to load balance each other, with Tomcat on the back end.<br>
><br>
> We're seeing the SERVERID cookie only being set intermittently, despite<br>
> the fact that as per our understanding it should be set with every response.<br>
><br>
> When the cookie is NOT set, the request isn't printed when haproxy is<br>
> running in debug mode, and the backend "Total Sessions" \
doesn't<br> > increment on the status page.<br>
><br>
> Here's our configuration, we'd sincerely appreciate any hints anyone \
may<br> > have.<br>
><br>
> Thanks,<br>
> -Chris<br>
> -----<br>
> global<br>
> log 127.0.0.1 local2 info<br>
> maxconn 4096<br>
> ulimit-n 8250<br>
> chroot /home/haproxy<br>
> user haproxy<br>
> group haproxy<br>
> daemon<br>
> quiet<br>
> pidfile /home/haproxy/haproxy.pid<br>
><br>
> defaults<br>
> log global<br>
> mode http<br>
> option httplog<br>
> option dontlognull<br>
> retries 3<br>
> redispatch<br>
> maxconn 2000<br>
> contimeout 5000<br>
> clitimeout 60000<br>
> srvtimeout 60000<br>
> stats uri /gz-haproxy-status<br>
> 120<br>
> cookie SERVERID insert indirect nocache<br>
> no option transparent<br>
><br>
><br>
> frontend haproxy *:85<br>
> default_backend tomcat<br>
><br>
> backend tomcat<br>
> balance roundrobin<br>
> option httpchk GET /warehouse/static/images/gazelle_logo_tm.png<br>
</div></div>> server stg_wh_1 <a href="http://10.94.246.222:8181" \
target="_blank">10.94.246.222:8181</a> <<a href="http://10.94.246.222:8181" \
target="_blank">http://10.94.246.222:8181</a>> cookie<br> <div class="im">> \
i-9b333efb check inter 9000 ri<br> > se 2 fall 3 port 8181 maxconn 1000<br>
</div>> server stg_wh_2 <a href="http://10.223.37.147:8181" \
target="_blank">10.223.37.147:8181</a> <<a href="http://10.223.37.147:8181" \
target="_blank">http://10.223.37.147:8181</a>> cookie<br> <div class="HOEnZb"><div \
class="h5">> i-73b5be11 check inter 9000 ri<br> > se 2 fall 3 port 8181 maxconn \
10<br> ><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