There seem to be 2 ways to push metrics to graphite/carbon,
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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With