Timers and counters in Apache module

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

 



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:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/examples/mod_example_ipc.c?revision=1211680&view=co
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