← Back to team overview

graphite-dev team mailing list archive

Re: [Question #178316]: How will relay behave if the storage server(s) become unavailable?

 

Question #178316 on Graphite changed:
https://answers.launchpad.net/graphite/+question/178316

chrismd proposed the following answer:
The relay only queues datapoints in memory, up to MAX_QUEUE_SIZE
datapoints per destination. Once a send queue (to any destination) fills
up the relay will stop accepting more datapoints from all clients
(because there is no coupling between clients and destinations its
impossible to selectively pause them). This is the default behavior if
USE_FLOW_CONTROL is True, if its False the relay will simply drop
datapoints if there is no room to put them in the send queue.

There are a lot of situations where this behavior sucks. A better
alternative in many situations is to use carbon-client.py. You give it a
list of destinations to send to (typically carbon-caches) and then write
metrics in the usual plaintext format its stdin. It can use relay-
rules.conf or consistent hashing just like the relay (they share lots of
code). One difference is that carbon-client.py always behaves like
USE_FLOW_CONTROL=True, it will block reading stdin and wait until data
can be sent. The advantage though is that now you're blocking per-client
and you can control the client behavior (choose to timeout and kill the
carbon-client, do something else with the data like write it to a file
that carbon-client can later read, etc) but you have to implement that
behavior in the calling program.

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.


References