poolboy icon indicating copy to clipboard operation
poolboy copied to clipboard

Pool statistics

Open reiddraper opened this issue 11 years ago • 11 comments

When observing a running system, it would be nice if poolboy provided statistics on the usage of the pool. Has the pool ever been empty? How long are processes checked out for? How often are pooled processes (or their temporary owners) crashing? I suspect there are several other things it would be useful to have metrics for. The simplest that would be personally useful for me is just a simple max_workers_ever, which a function to reset the stat. Do others think these kind of things would be useful? Would observing such things with something like folsom have too much overhead?

cc/ @Vagabond

reiddraper avatar Apr 02 '13 02:04 reiddraper

I guess my main concern would be the additional dependency. Maybe we could allow registration of a 'stats callback module' that would get called every time certain things happened?

Vagabond avatar Apr 02 '13 03:04 Vagabond

Perhaps we could register a callback module in the options.

devinus avatar Apr 09 '13 17:04 devinus

Is a single, resettable max_workers_ever stat generally useful in the meantime? The others stats are something I'd like to eventually get to, but are lower on my priority list.

reiddraper avatar Apr 09 '13 19:04 reiddraper

@reiddraper I could be completely misunderstanding you, but the max_workers_ever is just the pool size + the max overflow.

devinus avatar Apr 09 '13 19:04 devinus

I could be completely misunderstanding you, but the max_workers_ever is just the pool size + the max overflow.

What I'm curious about is max number of workers checked out. The scenario is, I jump on the box when things are going wrong, or I'm just curious about resource utilization, and I start typing poolboy:status(mypool). If the status is changing quickly over time, I might not catch it when the pool is ever empty (or full, depending on your perspective). So I want to be able to answer the question, are my processes ever blocked waiting for a worker?

reiddraper avatar Apr 10 '13 17:04 reiddraper

@reiddraper I see what you mean now. I do support registering a callback module for this sort of thing that you can store statistics in with e.g. ets, but I don't think Poolboy proper should be keeping statistics ot her than the current pool status. @Vagabond thoughts?

devinus avatar Apr 10 '13 17:04 devinus

+1, this would actually be helpful for production systems

lrascao avatar Jan 08 '15 11:01 lrascao

+1, extremely helpful

imtutta avatar Jun 19 '17 17:06 imtutta

This would be very helpful.

hunterboerner avatar Aug 04 '17 17:08 hunterboerner

This would be extremely helpful

lswith avatar Nov 08 '18 23:11 lswith

wow, this started in 2013, 10 years ago, these days I guess makes more sense if it's provided a telemetry support, what do you think? @devinus @Vagabond

manuel-kaleyra avatar Sep 14 '23 14:09 manuel-kaleyra