Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add object store cache for GCS #634

Merged
merged 3 commits into from
May 23, 2024

Conversation

benjamin-awd
Copy link
Contributor

@benjamin-awd benjamin-awd commented May 23, 2024

Resolves #621

This PR:

  1. Changes the construct_gcs function to async, which should hopefully improve performance
  2. Adds a cache so to prevent redundant DNS lookups
  3. Adds an alternative way to create the GCS builder via a GOOGLE_SERVICE_ACCOUNT_KEY

Currently, every checkpoint instantiates a ObjectStore leading to a large number of calls to the metadata server. This can lead to a high number of concurrent DNS lookups, which may cause network latency and other undesirable effects. While the GCE metadata service endpoint has no official rate limit, we should avoid making unnecessary calls to it.

Took reference from Polars on this: pola-rs/polars#14384 (comment), https://github.com/pola-rs/polars/blob/main/crates/polars-io/src/cloud/object_store_setup.rs#L4

Note: the AWS metadata endpoint has a rate limit of 1024 packets per second, so it might be worth implementing this for the construct_s3 function as well at some point.

Copy link
Member

@mwylde mwylde left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for the contribution. Can you confirm that this addresses #621?

@mwylde mwylde merged commit 627c8a1 into ArroyoSystems:master May 23, 2024
3 checks passed
@benjamin-awd
Copy link
Contributor Author

This is great! Thanks for the contribution. Can you confirm that this addresses #621?

It's looking a lot better so far on our end, but will keep an eye on it -- I think our remaining issues are due to how the NATS connector handles checkpointing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API throttle when using GCS as checkpoint backend
2 participants