Iis – Measuring page response time for different servers in web farm (HAProxy?)

haproxyiisresponse-timeweb-server

I'm building out a small webserver farm (IIS7.5) to serve up an internal website. One of the things I want to measure is what the HTTP response time is between user requests and the page being served.

Given that I'm using HAProxy as a front-end load balancer, it would seem natural that HAProxy would be in an ideal place to collect this information, as it sits between every request/response. However, looking at the generated stats page, there's a lot of good information but I can't see anything about response times.

What would be the best way to go about doing this? Is this a function that HAProxy can do, or would I need some other specialist monitoring software?

Best Answer

HAProxy provides very detailed statistics about all HTTP requests. Way more than you see on the stats page.

You need to setup a syslog server listening to UDP syslog messages (e.g. on localhost). That syslog server needs to be configured to write the log messages received by HAProxy to a file (or wherever you like it). An example HAproxy configuration could look like this:

defaults
  # send the logs to localhost:514 via UDP, using the local0 facility
  log 127.0.0.1 local0 debug
  option httplog

  mode http
  balance roundrobin

listen farm
  bind 10.0.0.1:80

  server iis1 10.0.1.1:80
  server iis2 10.0.1.2:80

See section 8 of the configuration manual for detailed information about the log format and how to set it up.