Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphite pickle vs line receiver

There seem to be 2 ways to push metrics to graphite/carbon,

  1. Line receiver
  2. Pickle receiver

As per the docs http://graphite.readthedocs.org/en/1.0/feeding-carbon.html pickle is better as it allows batching multiple metrics in a single call.

But one can batch metrics to the line receiver as well by separating the metrics using newline. For ex:

echo -e "local.random.diceroll4 40 `date +%s`\nlocal.random.diceroll5 400 `date +%s`" | nc localhost 2003

So given the additional overhead of pickling/un-pickling the metrics, when and why is the pickle receiver better than the line receiver?

like image 953
vinodv26 Avatar asked Apr 04 '13 15:04

vinodv26


1 Answers

Pickle allows you to send multiple timestamp/value pairs for a single metric. The doc does state that it's faster than the line-by-line protocol, but does not give a reason. One possibility is that by batching multiple values for the same metric, the .wsp file is open and in cache for the 2nd and later data points. It seems unlikely that it would be more efficient if you only provide one time/value pair each time a metric is named.

like image 199
TomG Avatar answered Nov 01 '22 19:11

TomG