ApacheTop is a Common Log Format analyser I wrote in C++ around 2003. It displays realtime statistics about webserver log entries in a curses interface, inspired by top.
It came in pretty useful when I worked at the BBC for spotting trends on the webservers – which URLs were generating the most traffic in real time was quite a useful statistic.
It hasn’t seen any development from me in about a decade, but has recently been revived and now has a Github repository (I’m not the owner of this repo).
It produces a display of statistics in a terminal like this:
last hit: 09:17:07 atop runtime: 0 days, 00:58:20 09:17:08 All: 638924 reqs ( 182.65/sec) 3433539K ( 981.6K/sec) ( 5.4K/req) 2xx: 455415 (71.3%) 3xx: 175745 (27.5%) 4xx: 7746 ( 1.2%) 5xx: 10 ( 0.0%) R ( 30s): 5195 reqs ( 173.17/sec) 25405K ( 846.8K/sec) ( 4.9K/req) 2xx: 3447 (66.4%) 3xx: 1715 (33.0%) 4xx: 33 ( 0.6%) 5xx: 0 ( 0.0%) REQS REQ/S KB KB/S URL 103 3.4 2983 99.4 / 56 1.9 239 8.0 /tickerdata/story2.dat 47 1.6 104 3.6 /home/today/patina.js 44 1.5 82 2.8 /home/styles/home_d0e2ee.css
The header is displaying all requests (and requests per sec) and bytes since ApacheTop started. It also breaks down the response codes into 2xx (200-299), 3xx, 4xx, and 5xx buckets. Below that is the same data for recent requests (in this case the last 30 seconds, which is configurable for a given time period or a specific number of requests).
Finally there’s a list of the most requested objects. This can be sorted by any of the shown columns and also filtered by URL.
It’s on my list to rewrite this in Ruby and bring it up to date, but as I don’t currently admin any webservers of note it’s a fairly low priority.
[tags: c++, project]