I have an application running under apache that I want to keep “in the moment” statistics on. I want to have the application tell me things like:
- requests per second, broken down by types of request
- latency to make requests to various backend services via thrift (broken down by service and server)
- number of errors being served per second
- etc.
I want to do this without any external dependencies. However, I’m running into issues sharing statistics between apache processes. Obviously, I can’t just use global memory. What is a good pattern for this sort of issue?
The application is written in python using pylons, though I suspect this is more of a “communication across processes” design question than something that’s python specific.
Perhaps you could keep the relevant counters and other statistics in a memcached, that is accessed by all apache processes?