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

reduce number of calls to Horizon when updating caches #208

Open
acharb opened this issue Jan 11, 2022 · 0 comments
Open

reduce number of calls to Horizon when updating caches #208

acharb opened this issue Jan 11, 2022 · 0 comments

Comments

@acharb
Copy link
Contributor

acharb commented Jan 11, 2022

see if we can reduce the number of calls to Horizon. For example the v1 updateApiLumens method calls Horizon 40 times simultaneously every 10 mins.

commonLumens.totalSupply - 2
commonLumens.circulatingSupply - 22
commonLumens.directDevelopmentAll - 4
commonLumens.distributionEcosystemSupport - 5
commonLumens.distributionUseCaseInvestment - 2
commonLumens.distributionUserAcquisition - 5

Total horizon calls: 40

and some of these calls are repeats (eg. circulatingSupply calls totalSupply).

This large number of calls at once creates intermittent Horizon timeout errors, as well as the length of the tests (when Horizon responses are even slightly slower, because of the many calls it creates a large lag where you have to increase the time of the backend tests to be able to handle, eg).

some possible options to explore are:

  • deprecate endpoints (or deprecate fields w/in endpoints)
  • cache each granular horizon endpoint data, and then on the api endpoints compute the responses from the caches on the fly. This should prevent repeat-horizon calls.
  • possibly use hubble for some/all of this data instead of calling Horizon. Hubble also has some limitations (cost/query, updates every 30 mins), that will need to be looked into though
@acharb acharb changed the title reduce number of calls to Horizon reduce number of calls to Horizon when updating caches Jan 11, 2022
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

No branches or pull requests

1 participant