server: background data api loading #2151
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A dex host that has been up for just several months with a handful of markets can take more than a minute to start as it waits to load.
Here is a very tolerable example with younger markets:
It adds up with more markets and it grows with time (more epochs stored).
Two thoughts this PR is investigating:
I started this branch an in August 2022, but never got to finishing it, partly because I forgot. This is here as a placeholder and for comments.
The other obvious question is how can this loading be optimized, and what is the hotspot. I did profile at one point and it's mostly in the Go DB code that's binning the data. PostgreSQL and/or disk to not seem to be much issue.