[nycbug-talk] Any web stat program that collects data on time to serve

Chris Snyder chsnyder at gmail.com
Mon Aug 1 17:08:06 EDT 2011


On Mon, Aug 1, 2011 at 4:41 PM, Edward Capriolo <edlinuxguru at gmail.com> wrote:
> I have been tasked with collecting the time-to-serve (milliseconds) from
> apache logs. I know this is a really fun and interesting tasks. I setup
> awstats which I thought had this out of the box. I was wrong. Does anyone
> know a tool/package that can collect and display 'time to serve' in a
> meaningful way to try and help find "the slow page". I am looking for
> something I do not have to code up myself, because frankly then i am
> responsible for it indefinitely. (and I have other things to deal with)
>

As you've discovered, Apache doesn't log the request separate from the
response, so a log analyzer is no help here.

If the higher-ups are only interested in server time, as opposed to
page-load time, you can add code to the controller that keeps track of
how long it takes PHP (or whatever) to generate the response, from the
time the controller starts processing to the end. Then write the times
to a log or database. If there's not just one controller script, you
can use auto_prepend and auto_append configuration directives to
include the profiling code.

If they are interested in actual page load times in real browsers,
you'll need to use a javascript approach that starts timing in <head>,
stops on page load, and uses an ajax request to send the results to a
tracking server. There must be 3rd party services that do this.

As you can see, very different approaches depending on what you
actually want to measure.



More information about the talk mailing list