Author Topic: Session tracking under HAProxy load balancer  (Read 55628 times)

ushacomm

  • Customer
  • Newbie
  • *
  • Posts: 34
    • View Profile
Session tracking under HAProxy load balancer
« on: July 09, 2012, 02:28:44 AM »
Hi,

We have configured AjaxSwing Tomcat instances to run under HAproxy load-balancer. The configuration used is as below:

listen U5WEB aaa.bbb.ccc.ddd:8080
      mode http
      cookie JSESSIONID prefix
      balance roundrobin
      option httpclose
      option forwardfor
      server LEONO 10.2.88.96:8040 cookie U5WEB_SERVER_01 check
      server MIO AAA:BBB.CCC.DDD:8040 cookie U5WEB_SERVER_02 check

Now after opening the app in a browser, on hitting F5 (Refresh), we get the following log in HA_Proxy:


Jul  5 11:25:23 localhost.localdomain haproxy[24134]: 10.2.92.8:3400 [05/Jul/2012:11:25:23.332] U5WEB U5WEB/LEONO 0/0/1/2/6 304 142 - - --NN 1/0/0/0/0 0/0 "GET / HTTP/1.1"
Jul  5 11:25:23 localhost.localdomain haproxy[24134]: 10.2.92.8:3401 [05/Jul/2012:11:25:23.399] U5WEB U5WEB/MIO 0/0/1/2/6 304 142 - - --NN 1/0/0/0/0 0/0 "GET /bg.gif HTTP/1.1"
Jul  5 11:25:23 localhost.localdomain haproxy[24134]: 10.2.92.8:3402 [05/Jul/2012:11:25:23.412] U5WEB U5WEB/LEONO 0/0/2/2/6 304 144 - - --NN 1/0/0/0/0 0/0 "GET /index.png HTTP/1.1"
Jul  5 11:25:29 localhost.localdomain haproxy[24134]: 10.2.92.8:3403 [05/Jul/2012:11:25:29.899] U5WEB U5WEB/MIO 0/0/1/2/13 200 1678 - - --NN 2/0/0/0/0 0/0 "GET / HTTP/1.1"
Jul  5 11:25:29 localhost.localdomain haproxy[24134]: 10.2.92.8:3404 [05/Jul/2012:11:25:29.966] U5WEB U5WEB/LEONO 0/0/2/2/13 200 1820 - - --NN 2/0/0/0/0 0/0 "GET /bg.gif HTTP/1.1"
Jul  5 11:25:30 localhost.localdomain haproxy[24134]: 10.2.92.8:3405 [05/Jul/2012:11:25:29.980] U5WEB U5WEB/MIO 0/0/1/2/149 200 296358 - - --NN 2/0/0/0/0 0/0 "GET /index.png HTTP/1.1"
Jul  5 11:25:56 localhost.localdomain haproxy[24134]: 10.2.92.8:3406 [05/Jul/2012:11:25:56.533] U5WEB U5WEB/LEONO 0/0/2/2/13 200 1678 - - --NN 2/0/0/0/0 0/0 "GET / HTTP/1.1"
Jul  5 11:25:56 localhost.localdomain haproxy[24134]: 10.2.92.8:3407 [05/Jul/2012:11:25:56.594] U5WEB U5WEB/MIO 0/0/1/2/6 200 1820 - - --NN 2/0/0/0/0 0/0 "GET /bg.gif HTTP/1.1"
Jul  5 11:25:57 localhost.localdomain haproxy[24134]: 10.2.92.8:3408 [05/Jul/2012:11:25:56.608] U5WEB U5WEB/LEONO 0/0/2/2/499 200 296358 - - --NN 2/0/0/0/0 0/0 "GET /index.png HTTP/1.1"

Is this intended behavior?
Abhijit.

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
Re: Session tracking under HAProxy load balancer
« Reply #1 on: July 09, 2012, 03:31:59 AM »
These requests are going to index page, not application. What are you seeing in browser? Do you still get your application after refresh?