Proxy for etsy/statsd.
etsy/statsd comes with a proxy in nodejs, and we are running it on a single server, proxing a statsd cluster via an udp port. But we found that this nodejs proxy is losing packets, up to 30~40% sometimes!
Cpus are idle but packets are being lost. In our case, one api call makes one statsd request, maybe the single udp socket is too busy.
We tried to use SO_REUSEPORT
on the original nodejs proxy, this enables us to bind multiple udp sockets on a single port, but nodejs(or libuv) has disabled this option, and golang just dosen't have a method setsockopt()
.
Therefore, we made it in C.
SO_REUSEPORT
)Linux 3.9+.
$ ./autogen.sh $ ./configure $ make
Usage: ./statsd-proxy -f ./path/to/config.cfg Options: -h, --help Show this message -v, --version Show version -d, --debug Enable debug logging Copyright (c) https://github.com/hit9/statsd-proxy
MIT (c) Chao Wang hit9@github.com 2015.