Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

capture: add overflow_enabled option #43

Merged
merged 1 commit into from
May 27, 2024
Merged

Conversation

xvello
Copy link
Contributor

@xvello xvello commented May 27, 2024

We had disabled capture-led overflow on cloud for 6 weeks now (by disabling it on python, and setting very high values on rust). This overflow accounting is using a significant amount of memory and I want to double-check that the cleanups are not contributing to latency.

  • Add new OVERFLOW_ENABLED envvar, default to false as that's what we want for hobby/local + the current behaviour on cloud (very high values)
  • KafkaSink now takes a Option<OverflowLimiter>. Could have extracted a trait, but checking for the Option is probably cheaper than calling a method that always returns true. Plus we might just want to rip it out altogether and only keep overflow_forced_keys?
  • Update end2end test

@xvello xvello requested a review from a team May 27, 2024 09:56
Comment on lines +67 to +70
let partition = partition.clone();
tokio::spawn(async move {
partition.clean_state().await;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, wondering if we should Arc also the OverflowLimiter's forced_keys HashSet, since that's being cloned here it could be expensive if it's too large.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyways, seems like that was there from before, not a blocker on this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. forced_keys is empty though, supported as a last resort if the volume is so big that plugin-server cannot forward to overflow fast enough. Cloning it as long as it has a zero or a couple of entries might be cheaper than the Arc.
Should probably be superseeded by a redis zset instead.

@xvello xvello merged commit ebaf596 into main May 27, 2024
4 checks passed
@xvello xvello deleted the xvello/overflow_enabled branch May 27, 2024 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants