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

Better control excessive traffic to Dgraph #2678

Merged
merged 21 commits into from
Oct 19, 2018
Merged

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Oct 19, 2018

  • Proposal retries generate a lot of traffic for an already jammed system. Now we consider each proposal retry to have an exponentially increasing weight (2^retry), which is limited against pending_proposal flag.
  • For all the retries, the pending proposals rate limiter bleeds the count back slowly over time, to help with the congestion.
  • Remove btree concept, which was the cause of deadlocks during LRU.gets. The reason it was put in place was because Dgraph used to not write commits to disk earlier (keeping them in memory). That has changed now, with each commit going to disk before a read is done. So, we don't need to maintain this data structure. This speeds up mutations considerably.

Note that the lack of btree also means that a txn won't be able to read back its own uncommitted writes to secondary indices. I think that's a rare use case and hence a fair tradeoff, given the complexity and cost of having to overlay this structure on the DB.


This change is Reviewable

systest/mutations_test.go Show resolved Hide resolved
systest/mutations_test.go Show resolved Hide resolved
@manishrjain manishrjain merged commit a2e8376 into master Oct 19, 2018
@manishrjain manishrjain deleted the mrjn/speed-up-live-load branch October 19, 2018 23:24
danielmai added a commit to dgraph-io/pydgraph that referenced this pull request Dec 13, 2018
This test case to read-index-after-write within the same txn is no longer valid. See dgraph-io/dgraph#2678
danielmai added a commit to dgraph-io/pydgraph that referenced this pull request Dec 19, 2018
This test case to read-index-after-write within the same txn is no longer valid. See dgraph-io/dgraph#2678
martinmr pushed a commit to dgraph-io/pydgraph that referenced this pull request Dec 20, 2018
This test case to read-index-after-write within the same txn is no longer valid. See dgraph-io/dgraph#2678
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
- Proposal retries generate a lot of traffic for an already jammed system. Now we consider each proposal retry to have an exponentially increasing weight (2^retry), which is limited against `pending_proposal` flag.
- For all the retries, the pending proposals rate limiter bleeds the count back slowly over time, to help with the congestion.
- Remove `btree` concept, which was the cause of deadlocks during LRU.gets. The reason it was put in place was because Dgraph used to not write commits to disk earlier (keeping them in memory). That has changed now, with each commit going to disk before a read is done. So, we don't need to maintain this data structure. This speeds up mutations considerably.

Note that the lack of `btree` also means that a txn won't be able to read back its own uncommitted writes to secondary indices. I think that's a rare use case and hence a fair tradeoff, given the complexity and performance cost of having to overlay this structure on the DB.

* Working towards speeding up live loader.
* Wait before re-proposing, so we don't create too much work.
* Make rollup happen only once every 5m.
* Slowly bleed back to the proposal limit.
* Remove btree, gain performance.
* Works nicely with a lot of traffic now.
* Make tests work in query pacakge by ensuring that our commits are written to disk.
* Fix systest, testtxn and other tests.
* Add an Ignore method to keep linter happy (not used in this PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants