cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

CDC: Option to throttle

Open amruss opened this issue 5 years ago • 4 comments

Backfilling tables with large amounts of data (on the order of 10TB) could cause network congestion as well as possible buffer overflow of downstream processors. Additionally many downstream sinks are have a limit of how much incoming traffic they can handle. We've had users request throttling of backfills and of general changefeed traffic.

Add changefeed throttle option:

  • WITH rate_limit option applied per changefeed
  • Rate distributed amongst the nodes (ie each node's rate is rate_limit/n)
  • Ideally we'd have the option to set either in terms of rows/second or mb/second. But initial version it is fine to just implement in terms of rows/second (should be much easier on the implementation side).
  • Specify in rows/sec, maybe mb/sec: rate_limit=5 means “5 rows per second” or rate_limit="5mb" “5mb per second”.
  • Ideally we'd have support for all sinks, but initial version support for just kafka is okay

Additionally, we should set an expectation of what the average emission rate will be. There seems to be a user expectation of ~60% of the rate_limit, but open to differing opinions here.

Jira issue: CRDB-3350

amruss avatar Jan 13 '21 20:01 amruss

Hi @amruss, please add a C-ategory label to your issue. Check out the label system docs.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

blathers-crl avatar Jan 13 '21 20:01 blathers-crl

Network congestion seems like a valid reason. Doing distributed rate limit seems hard and furthermore unmotivated. Single node rate limiting of data rates for all changefeeds as a cluster settings seems all-in-all pretty sound and not a big lift.

ajwerner avatar Jan 14 '21 00:01 ajwerner

Customer feedback on the throttle feature request: They would prefer the per-node limit to also be per-backfill. They were thinking of the case where there were two backfills on the node going to different kafka topics or even clusters. Its not ideal to have the rate limit affect both when the topics/clusters could take different amounts of traffic. For example, the per-node & backfill rate limit would allow them to let backfill A run at 200k/sec per node and backfill B run at 100k/sec per node.

lancel66 avatar May 14 '21 17:05 lancel66

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!

github-actions[bot] avatar Sep 05 '23 11:09 github-actions[bot]