httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrej van der Zee" <>
Subject Re: number of bytes/packets sent/received
Date Thu, 09 Oct 2008 13:44:18 GMT
Thanks for your reply!

> Giving it a second thought, the problem looks complicated. Such
> filter-based counters would count the traffic of _one_ apache process.
> When you increment the counter, you have to protect it from concurrent
> access by other threads running in the same apache child process.
> Then, before the apache child process exits, you need to add the
> counter to a global counter shared among apache child processes (which
> has to be protected against race conditions as well). It's really
> hairy. Don't do it in apache.

I forgot to mention, but I need the number of packets / bytes per HTTP
request and log it to a database with other information. So I guess
that would take case of all the hairy stuff. I think I will give it a
go as you recommend with an input and output filter that only counts
the bytes and just passes on the data, unless somebody comes with a
better idea (what about the content-length for example, can I trust
this?). I understood from your email that the headers are counted with
it (I never wrote a filter before) and that's exactly what I need.


View raw message