Hi all,

I am having a very strange issue with HAProxy in that I wanted to
setup a simple sample that delegates to two instances of Jetty on my
machine. Each Jetty instance works perfectly when accessed directly
and increments a value in the session as it should.

However, when I access through HAP, I see the following in my log file:

Dec  8 12:26:06 127.0.0.1 haproxy[2937]: 127.0.0.1:52325
[08/Dec/2010:12:26:06.131] yourdomain_cluster
yourdomain_cluster/server1 0/0/0/4/4 200 646 -
JSESSIONID=HZEEB54EBF02B24933A0825 ---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
Dec  8 12:26:06 127.0.0.1 haproxy[2938]: 127.0.0.1:52327
[08/Dec/2010:12:26:06.182] yourdomain_cluster
yourdomain_cluster/server1 0/0/0/2/2 200 542
JSESSIONID=HZEEB54EBF02B24933A0825 - ---- 0/0/0/0/0 0/0 "GET
/favicon.ico HTTP/1.1"
Dec  8 12:26:13 127.0.0.1 haproxy[2937]: 127.0.0.1:52350
[08/Dec/2010:12:26:13.429] yourdomain_cluster
yourdomain_cluster/server1 0/0/0/2/2 200 542
JSESSIONID=HZEEB54EBF02B24933A0825 - ---- 0/0/0/0/0 0/0 "GET /
HTTP/1.1"
Dec  8 12:26:13 127.0.0.1 haproxy[2938]: 127.0.0.1:52353
[08/Dec/2010:12:26:13.479] yourdomain_cluster
yourdomain_cluster/server2 0/0/0/32/32 200 646
JSESSIONID=HZEEB54EBF02B24933A0825 JSESSIONID=HZ4ECA6F75E7FE4D1C980EA
---- 0/0/0/0/0 0/0 "GET /favicon.ico HTTP/1.1"
Dec  8 12:26:17 127.0.0.1 haproxy[2937]: 127.0.0.1:52364
[08/Dec/2010:12:26:17.137] yourdomain_cluster
yourdomain_cluster/server2 0/0/0/5/5 200 542
JSESSIONID=HZ4ECA6F75E7FE4D1C980EA - ---- 0/0/0/0/0 0/0 "GET /
HTTP/1.1"
Dec  8 12:26:17 127.0.0.1 haproxy[2938]: 127.0.0.1:52366
[08/Dec/2010:12:26:17.161] yourdomain_cluster
yourdomain_cluster/server2 0/0/0/2/2 200 542
JSESSIONID=HZ4ECA6F75E7FE4D1C980EA - ---- 0/0/0/0/0 0/0 "GET
/favicon.ico HTTP/1.1"
Dec  8 12:26:21 127.0.0.1 haproxy[2937]: 127.0.0.1:52379
[08/Dec/2010:12:26:21.145] yourdomain_cluster
yourdomain_cluster/server1 0/0/0/6/6 200 646
JSESSIONID=HZ4ECA6F75E7FE4D1C980EA JSESSIONID=HZ15E85FFF814E4D068808B
---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
Dec  8 12:26:21 127.0.0.1 haproxy[2938]: 127.0.0.1:52381
[08/Dec/2010:12:26:21.166] yourdomain_cluster
yourdomain_cluster/server1 0/0/0/1/1 200 542
JSESSIONID=HZ15E85FFF814E4D068808B - ---- 0/0/0/0/0 0/0 "GET
/favicon.ico HTTP/1.1"


Notice how it serves a couple of requests and despite reading the
JSESSIONID cookie on the incoming request, assigns a new session in
the response (because it delegated to the wrong server i'm guessing?)

This is my config:


global
  daemon
  maxconn 10000
  nbproc 2
  log 127.0.0.1 local2

defaults
  log global
  clitimeout 60000
  srvtimeout 30000
  contimeout 4000
  retries 3
  option redispatch
  option http-server-close
  option abortonclose
  option httplog

listen yourdomain_cluster 127.0.0.1:9999
  mode http
  balance roundrobin
  capture cookie JSESSIONID len 34
  appsession JSESSIONID len 34 timeout 3h
  option forwardfor
  server server1 127.0.0.1:3000 cookie s1 weight 1 maxconn 2000 check
  server server2 127.0.0.1:3001 cookie s2 weight 1 maxconn 2000 check

listen  lb1_stats 127.0.0.1:9090
  mode http
  stats uri /
  stats auth admin:password
  stats refresh 5s


Anything there that looks funky that could be causing this?

Cheers, Tim

Reply via email to