-
Notifications
You must be signed in to change notification settings - Fork 501
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
services/horizon/expingest: Ingest into memory only flag #2299
services/horizon/expingest: Ingest into memory only flag #2299
Conversation
I realized that we should also check the condition in |
Nice! With this change, do I understand correctly that it would be possible to have front-end instances that serve e.g. the orderbook graph from memory, without having them be ingesters writing to the DB? That would imply that we could then split a cluster into true front end (serving requests) and backend (pure ingestion to DB), correct? |
@ire-and-curses exactly! |
@bartekn I like the idea you mentioned of using a read only connection. Along the same lines, I think you can set the ingestion transaction to be read only by calling |
@bartekn it turns out that postgres does not allow select for update queries on read only transactions. if we want to restrict ingestion to use read only connections when I've confirmed that postgres advisory locks do work on read only transactions. The advantage of this approach is that it maintains the existing locking behavior. I think that it is probably safe for us to avoid locking when |
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
This commit adds a config flag that makes ingestion system to ingest into memory structures only.
Close #2250.
Why
Currently it's not possible to move ingestion system entirely to backend server. Because of this a spike in requests to frontend servers may increase CPU usage and slow down ingestion. To solve this, it's now possible to set
INGEST_IN_MEMORY_ONLY
config flag that would make the instance wait until other ingesting instance updates a DB and then it will just catchup ingesting into memory structures only.Known limitations
This requires more tests before releasing so probably shouldn't be included in 1.0.0.