HAProxy is a rock-solid, high performance TCP/HTTP load balancer. It’s what we use at Scout to proxy traffic to our app servers.
We’ve added a plugin to monitor HAProxy: just specify the URL to your HAProxy stats page and the name of the proxy. You’ll get the request rate, error rate, and proxy status for the specified proxy.
Why monitoring the load balancer is important
The load balancer is one of the best places to narrow down the cause of an outage. If all servers in a proxy aren’t processing requests, it’s often an indication of an outage further down the stack (ex: the database). If it’s isolated to a specific app server, the first place to look might be the downed app server.
The Scout HAProxy plugin gathers its metrics by parsing the output of the HAProxy Status page. It’s one of my favorite open source status pages: the page loads quickly and the color-coded statuses make it easy to focus on problem areas during an incident. The Scout plugin and the HAProxy status page play well together: if the plugin records a dramatic change in the throughput, error rate, or the proxy status, we’ll pull up the HAProxy status page and dig further.
Like all Scout plugins, installing the HAProxy plugin is just a couple of mouse clicks away. Just click the button in the Scout UI and select the HAProxy Monitoring plugin. Note that the plugin has one dependency: the fastercsv gem must be installed. See the plugin directory entry for more details on the plugin.
A big thanks to Jesse Newland for the initial version of this plugin.