Sorry, somehow I wasn't watching the repo and didn't notice this.
A couple thoughts:
The default 1 second interval is likely too much. We should probably reduce it to 0.1 or something.
We need to handle and upper size to that array. A sleep loop isn't good enough, we need to wake up the background thread if the buffer is past a certain size. I think we could do this with a Monitor, I need to explore that.
We noticed a memory leak on one of our Sidekiq deployments. With
rbtrace
and diffing heap dumps the indication was it was fromstatsd-instrument
gem.After setting
STATSD_FLUSH_INTERVAL
to 0, the memory leak disappeared (to use the UDPSink instead of BatchedUDPSink)Memory graphs before:
After: