httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vaughan Reid" <>
Subject MySQL Virtual Host and Traffic Module
Date Wed, 18 Mar 2009 13:26:03 GMT
Hi everyone,


I have been working on a module which, as the title suggests, takes virtual
hosts from a database but also does traffic logging back to the database. I
have the virtual hosts side of things working perfectly but am having some
issues getting traffic logging working the way I want it to.


What I have so far are 2 filters which gather the inbound traffic and
outbound traffic for each transaction. These work ok and when logging
transactions to file all of the in/out byte amounts appear to be correct.
The first problem however, is that each child has its own set of memory and
therefore keeps its own totals per virtual host. This also means that
multiple logging events occur for each transaction. I could just log this
all to database but it would 1) be inefficient and 2) cause the size of the
database to grow quite quickly.


I have read up on shared memory which is setup in the parent process before
all children spawn and is then attached to by each child as it is
initialised. This seems like an ok solution but I am not quite sure how to
keep all virtual host data separate within this structure. I will need a
traffic in and a traffic out counter for each host. Is there I am missing
here? If so please point it out.


The other option I considered was to use an SQLite database and write
everything to this until it is ready to be flushed to the main database.
This database would simply be emptied afterwards and the cycle would


Ideally can anyone tell me if there is a way to store data specific to a
virtual host which is global to all child processes? This is probably going
to be the best option if there is a way of doing this.


Any help would be greatly appreciated.



Vaughan Reid



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message