Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 7678 invoked from network); 18 Mar 2009 13:27:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2009 13:27:47 -0000 Received: (qmail 23798 invoked by uid 500); 18 Mar 2009 13:27:46 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 23770 invoked by uid 500); 18 Mar 2009 13:27:46 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 23759 invoked by uid 99); 18 Mar 2009 13:27:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2009 06:27:46 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [118.127.5.150] (HELO zambezi.cubosgaming.com) (118.127.5.150) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2009 13:27:36 +0000 Received: by zambezi.cubosgaming.com (Postfix, from userid 82) id 2DCEC78A7BC; Thu, 19 Mar 2009 00:27:32 +1100 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on zambezi.cubosgaming.com X-Spam-Level: Received: from chrome (203.161.96.51.static.amnet.net.au [203.161.96.51]) by zambezi.cubosgaming.com (Postfix) with ESMTPA id B3A5278A7B9 for ; Thu, 19 Mar 2009 00:27:31 +1100 (EST) From: "Vaughan Reid" To: Subject: MySQL Virtual Host and Traffic Module Date: Wed, 18 Mar 2009 22:26:03 +0900 Message-ID: <003001c9a7cd$16250930$426f1b90$@com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0031_01C9A818.860CB130" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcmnzRXAqs8CyDLoTE2xh0v+XQQUEg== Content-Language: en-au X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.5 required=5.0 tests=ALL_TRUSTED,AWL,HTML_MESSAGE autolearn=ham version=3.2.5 ------=_NextPart_000_0031_01C9A818.860CB130 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 continue. 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. Thanks, Vaughan Reid ------=_NextPart_000_0031_01C9A818.860CB130--