Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.
/ statsd-proxy Public archive

Fast consistent hashing proxy for etsy/statsd (no longer maintained ⚠️).

Notifications You must be signed in to change notification settings

hit9/statsd-proxy

Folders and files

NameName
Last commit message
Last commit date
Feb 5, 2021
Jun 6, 2016
Jun 6, 2016
Sep 30, 2019
Jun 6, 2016
Jun 6, 2016
Jun 6, 2016
Jun 6, 2016
Feb 5, 2021
Jun 6, 2016
Dec 2, 2015

Repository files navigation

Statsd-Proxy

Proxy for etsy/statsd.

Why

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.

Features

  • Zero dependencies.
  • Very very fast.
  • Multiple threading.
  • Reuseport support.
  • Packet aggregation.

Limitations

  • Only available on linux 3.9+ (option SO_REUSEPORT)
  • Only support udp server and udp backends.

Requirements

Linux 3.9+.

Build

$ ./autogen.sh
$ ./configure
$ make

Usage

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

License

MIT (c) Chao Wang hit9@github.com 2015.

About

Fast consistent hashing proxy for etsy/statsd (no longer maintained ⚠️).

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published