project-codeflare / multi-cluster-app-dispatcher

Holistic job manager on Kubernetes
Apache License 2.0
107 stars 63 forks source link

add: caching for Discovery Client #682

Open VanillaSpoon opened 11 months ago

VanillaSpoon commented 11 months ago

Issue link

closes https://github.com/project-codeflare/multi-cluster-app-dispatcher/issues/611

What changes have been made

Adding a Discovery Client cache, which will reduce the calls to the Discovery Client, and prevent throttling. The cache is then refreshed by a ticker every 5 hours.

Checks

openshift-ci[bot] commented 11 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign anishasthana for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/project-codeflare/multi-cluster-app-dispatcher/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
VanillaSpoon commented 10 months ago

Hey @KPostOffice, I believe mem cache would offer less latency between the discovery cache retrievals, as it appears to be the Discovery Api is used quite frequently. However, there may be other drawbacks to using the mem cache, so I'm open to suggestions/discussions on the topic :)

KPostOffice commented 10 months ago

@VanillaSpoon I'm unclear on exactly how the disk cache works if I'm being honest, because as part of the struct it wraps the memcache which makes me think that most requests will still go through the memcache.