Published October 25th, 2007

Do you have a custom logging module?

Ever wondered how long it took to actually finish logging?

At $work I was helping with some problems with Apache, and we wanted to know how long until an Apache Worker Process actually goes back into the Accept Queue.

So mod_timer is born. It hooks into Apache when the connection is accepted, before we start reading any data, and the timer ends when the connection memory pool is destroyed. It also performs the same measurements on requests inside the connection.

It produces a log file like this:

r: r: r: r: r: r: c: r: r: r: r: r: c:

Log Fields:

  • ‘r’ or ‘c’ represents if this is a request or connection being logged.

  • Remote IP Address

  • Remote Port

  • Start time, in aprtimet (64bit int time since 1970 in microseconds)

  • Run time in microseconds

Using this, it becomes easier to look for ‘evil’ clients that are doing things like sending one byte of a GET request a second.

Written by Paul Querna, CTO @ ScaleFT. @pquerna