1

Graphite-0.9.15

Python client written in python-3.7 connecting directly to Carbon.

I am following the docs here:

https://graphite.readthedocs.io/en/latest/feeding-carbon.html

Once you’ve formed a list of sufficient size (don’t go too big!), and pickled it (if your client is running a more recent version of python than your server, you may need to specify the protocol) send the data over a socket to Carbon’s pickle receiver (by default, port 2004).

payload = pickle.dumps(listOfMetricTuples, protocol=2)
header = struct.pack("!L", len(payload))
message = header + payload

How big is "too big"?

When using the pickle protocol, what is the maximum payload and/or message size in terms of:

  • number of tuples
  • actual byte size uncompressed
  • actual byte size compressed with protocol=2

What are the limits here on the server side?

4

1 回答 1

2

在你之后几年遇到这个问题。我可以通过反复试验得出最好的结论,您示例中的最大有效负载大小为 1048703,恰好是 1MiB 加上 127 个字节。我没有遇到元组数量的限制。如果记录了实际限制会很好,但是一旦您知道需要发送成批的元组就很容易了。

于 2021-10-07T16:23:47.707 回答