Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (64 sloc) 2.55 KB


This module enables the sending of Statsd statistics directly from Apache, without the need for a CustomLog processor. It will send one counter and one timer per request received.

For a request to, the stat format would be:


Where <prefix> and <suffix> are optionally configured (see DOCUMENTATION). The path gets converted from /foo/bar to and the HTTP method (GET) and the response code (200) are also part the stat.

The module is implemented as a logging hook into Apache's runtime, meaning it runs after your request backend request is completed and data is already being sent to the client.

On my very mediocre VM on my laptop, the average overhead per call was 400 microseconds, and on an AWS c1.medium about 20 microseconds per call. Any high end server hardware should be able to perform better than that.

I've written a companion module for Varnish as well called libvmod-statsd in case you're running Varnish instead/also.



Make sure you have apxs2 and perl installed, which on Ubuntu you can get by running:

$ sudo apt-get install apache2-dev perl

From the checkout directory run:

$ sudo ./ --install

This will build, install & enable the module on your system


You can install a Debian package from the Krux OpenSource repository by adding this to your apt sources.list (there is nothing lucid specific in the packaging; it should work on any other Debian/Ubuntu install):

deb lucid production
deb-src lucid production

And then running the following installation command:

$ sudo apt-get install libapache2-mod-statsd

Building your own package

Make sure you have dpkg-dev, cdbs and debhelper installed, which on Ubuntu you can get by running:

$ sudo apt-get install dpkg-dev cdbs debhelper

Then build the package by first compiling the module, then running buildpackage:

$ perl
$ dpkg-buildpackage -d -b


See the DOCUMENTATION file in the same directory as this README for an example configuration as well as all the documentation on the configuration directives supported.

Something went wrong with that request. Please try again.