Re: Timers and counters in Apache module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Take a look at mod_sflow, it maintains basic HTTP counters and periodically exports them using the sFlow protocol. The counters you are looking for may already be exported; the following article shows the counter and transaction data exported by mod_sflow:

http://blog.sflow.com/2011/01/http.html


On Fri, Sep 27, 2013 at 2:54 AM, Creg Zolast <cregzolast@xxxxxxxxx> wrote:
Hi,
I am currently developing a module in Apache 2.4.4

I need a counter that is going to count all requests in the system and based on a small processing, some of them are to be tagged and counted separately. I would like to do this the right way, in memory and not using shared file on the hard disk. 

At this point I can have a thread-safe counter per worker but I want to save it periodically into a DB. I was looking for some kind of timer-based event or something, or something like idle-event hook or anything (whatchdog would be my last idea) to be able to save periodically these counters into a DB.

Another way I found is working with shared memory like this example does:
but I have a doubt that the shared memory is actually a file on disk and for each counter incrementation the hard disk is accessed.

Please help me getting on the right track. Thank you.

Creg



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux