Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compression between carbon-c-relays? #212

Closed
azhiltsov opened this issue Sep 7, 2016 · 12 comments
Closed

compression between carbon-c-relays? #212

azhiltsov opened this issue Sep 7, 2016 · 12 comments

Comments

@azhiltsov
Copy link

Hi.
I am wondering could you implement a compression between carbon-c-relays?
It is a highly compressible protocol and could give significant saving on the bandwidth.

@grobian
Copy link
Owner

grobian commented Sep 8, 2016

Just wondering, do you actually see high bandwidth usage? Compression complicates things a bit, an interesting test would be to run an xz tunnel (or alike) and let the relay use that tunnel.

@azhiltsov
Copy link
Author

Yes we do. This is a traffic between relays and stores, as both of them are running carbon-c-relay it looks like an obvious solution to have a compression in between and keep a graphite compatible protocol for input and output flows
image

@dgryski
Copy link
Contributor

dgryski commented Sep 8, 2016

As a comparison, enabling compression between carbonserver<->carbonzipper gave:

network-gzip

@grobian
Copy link
Owner

grobian commented Sep 8, 2016

is that context aware compression, or generic "zipping" compression?

@dgryski
Copy link
Contributor

dgryski commented Sep 8, 2016

This was just gzipping the protobufs.

@grobian
Copy link
Owner

grobian commented Sep 8, 2016

that looks promising then

@xneo64
Copy link

xneo64 commented Nov 9, 2016

+1 this could save many $$ in ISP VPN bandwidth costs when transmitting data across data centres

@tehlers320
Copy link

If your multi-regional and have the budget you could have (carbon-c-relay -> telegraf -> kafka (with compression) -> telegraf elsewhere -> carbon-c-relay -> carbon-cache)

It's a bit of pipe but it does give you a big buffer for metrics that you could hang other things off of such as alarming/other graph systems. I've never seen a pipe like this in action so i'd wonder about the cpu use of telegraf/kafka.

@grobian
Copy link
Owner

grobian commented Nov 23, 2016

My problem (design-wise) with this thing, is that I need anchorpoints both send and receive to specify the traffic is compressed or not. Since the protocol isn't really having any wire version or something, it needs to use another port, but for that it needs configuration too.
Perhaps a separate program /is/ the easiest solution, like stunnel or something, or a different invocation of the c-relay so it can use metric-level compression or something. It could be a memory drain, but with some communication (huffman-trees?) between relays a high compression level could be reached. Or maybe that's too far-fetched, and is regular gzip compression already strong enough because producers typically generate trees of metrics that all share prefixes. Meh.

@azhiltsov
Copy link
Author

Separate invocation on the same port with enabled gzip compression should be sufficient for receiving part
For output streams this could be declared in config file on per-recipient basis.

@grobian
Copy link
Owner

grobian commented Feb 19, 2017

This is on my todo list, it will come with a way to configure listeners instead of the current "single port is everything" approach.

grobian added a commit that referenced this issue Aug 3, 2017
This is a very first part of the new listener approach, implementing
gzip support.  As noted in issue #212, compression can result in a huge
bandwith savings.  With this code I was able to use this config:

  listen linemode gzip 2013 proto tcp;

and then spool some metrics into the system using

  echo "foo.bar 1 2" | gzip -c - | nc localhost 2013
@grobian
Copy link
Owner

grobian commented Aug 13, 2017

in master there is support for sending and receiving gzipped and bzip2-ed streams.

@grobian grobian closed this as completed Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants