{"id":421,"date":"2008-03-05T16:51:20","date_gmt":"2008-03-05T15:51:20","guid":{"rendered":"http:\/\/wp.devco.net\/?p=421"},"modified":"2011-08-25T14:25:45","modified_gmt":"2011-08-25T13:25:45","slug":"detailed_apache_stats","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2008\/03\/05\/detailed_apache_stats.php","title":{"rendered":"Detailed Apache Stats"},"content":{"rendered":"
Apache has its native mod_status<\/a> status page that many people use to pull stats into tools such as Cacti<\/a> and other RRDTool<\/a> based stats packages. This works well but does not always provide enough details, questions such as these remain unanswered:\n<\/p>\n To answer this I wrote a script that keeps a running track of your Apache process, it has many fine grained controls that let you fine tune exactly what to keep stats on. I got the initial idea from an old ONLamp<\/a> article titled Profiling LAMP Applications with Apache’s Blackbox Logs<\/a>. <\/p>\n The article proposes a custom log format that provides the equivelant to an airplanes blackbox, a flight recorder that records more detail per request than the usual common log formats do. I suggest you read the article for background information. The article though stops short of a full data parser so I wrote one for a client who kindly agreed that I can opensource it. <\/p>\n Using this and some glue in my Cacti I now have graphs showing a profile of the requests I receive for the whole site, but as you are able to apply fine grained controls to select what exactly you’ll see, you could get per server overview stats and details for just a specific scripts performance and statuses:<\/p>\n The script creates on a regular interval a file that contains the performance data, the data is presented in variable=value<\/em> data pairs, I will soon provide a Cacti and Nagios plugin to parse this output to ease integration into these tools. <\/p>\n The performance data includes values such as:<\/p>\n\n
\n