Debugging tool for HAProxy

From: Christoph Dorn <christoph#christophdorn.com>
Date: Wed, 16 Apr 2008 12:30:08 -0700


I am the developer of FirePHP (http://www.firephp.org/) which is a debugging tool for PHP. It allows you to print debug messages from PHP on the server to the Firebug (http://www.getfirebug.com/) Console. It sends the debug data in the response headers instead of the response body so that page rendering in the browse is not affected.

I was wondering if this could be a useful tool to help in troubleshooting HAProxy configurations. HAProxy could insert some debug messages into the response headers which will then be picked up by the FirePHP extension. For each request, the user could then see what HAProxy did to service it right in the browser instead of having to go to the log files.

There could be a new configuration directive for HAProxy that enables the debug messages for specific IP's for instance.

The data in the header looks something like this:

X-FirePHP-Data-100000000001	{
X-FirePHP-Data-300000000001	"FirePHP.Firebug.Console":[
X-FirePHP-Data-399999999999	["__SKIP__"]],
X-FirePHP-Data-999999999999	"__SKIP__":"__SKIP__"}
X-FirePHP-Data-200000000001	"FirePHP.Dump":{
X-FirePHP-Data-299999999999	"__SKIP__":"__SKIP__"},
X-FirePHP-Data-355892512100	["LOG","Hello World"],
X-FirePHP-Data-355892528800	["LOG","Log message"],
X-FirePHP-Data-355892542900	["INFO","Info message"],
X-FirePHP-Data-355892557000	["WARN","Warn message"],
X-FirePHP-Data-355892571600	["ERROR","Error message"],
X-FirePHP-Data-355892599600	["LOG",["Label","Message with label"]],

It is simply a JSON (http://www.json.org) string that is broken up into different sections which are sorted by their numeric index. HAProxy could thus insert its debug messages into an existing structure or create its own if it did not already detect one from the application server.

You can see how this looks in the Firebug Console at: http://www.firephp.org/

Is this something that would be useful to have for HAProxy users?

On another note, Firefox accepts headers that are up to 10,000 characters long. Is there any limits in the standard HTTP protocol that restricts the length of headers? Is there a maximum length that is supported by all main-stream proxy server implementations?

Looking forward to your feedback.

Christoph Received on 2008/04/16 21:30

This archive was generated by hypermail 2.2.0 : 2008/04/16 21:45 CEST