Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

sometimes the HAProxy instance forwards the Statistics Report request to the backends instead of serving the statistics by itself.

i've tried with the following versions:

  • 1.3.15.2
  • 1.3.18
  • 1.3.22

every installed version does the same. the first stat request usually answered by HAProxy but after some reload in the browser it'll being forwarded

the corresponding part of the configuration looks like this:

global
  log 127.0.0.1   local0
  log 127.0.0.1   local1 notice

  maxconn 4096

  user haproxy
  group haproxy
  daemon
  nbproc  4

defaults
  log     global
  mode    http
  option  httplog
  option  dontlognull
  retries 3
  option redispatch
  maxconn 2000
  contimeout      5000
  clitimeout      10000
  srvtimeout      10000

  stats enable
  stats auth haproxy:test

backend appserver
  balance roundrobin

  reqidel ^X-Fowarded-For
  option httpchk GET / HTTP/1.0

  server appserver1 10.2.0.2:8080 weight 1 check
  server appserver2 10.2.0.3:8080 weight 1 check

frontend http
  bind 0.0.0.0:80

  default_backend appserver

as the README says. what could be the problem with this?

thanks!

share|improve this question

migrated from stackoverflow.com Feb 16 '10 at 8:35

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 3 down vote accepted

Simple: your configuration is missing a "option httpclose" statement in the defaults section. Just add this and it will be fixed. The reason is that if you send a stats request on a session that is already established with a server and kept alive, only the server sees it.

share|improve this answer
    
since yesterday I'm using the 'forceclose' option because it'll close those connections that are not closed by the client. and since 'forceclose' includes 'httpclose', it fixed it. so thanks for the answer it fixed my problem! the only thing I don't understand is: the established connection was made by my client to the HAProxy. it served the request so it should not forward this one to any of the backends because it is a stat request, not a normal one. so it seems like a bug in HAProxy. –  KARASZI István Dec 23 '09 at 10:21
    
No, it's simply because you made one first request to your server, and your browser established a keep-alive connection to that one. Then you go to the stats and the browser reuses the same connection since it's on the same site. Unfortunately, haproxy does not see the request which is considered as pure data of the first connection. Version 1.4 adds support for keep-alive which will definitely solve those common issues. –  Willy Tarreau Jan 17 '10 at 7:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.