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

mvcc: Limit number of bbolt read transactions opened by committed reads #3

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

jpbetz
Copy link
Owner

@jpbetz jpbetz commented Feb 13, 2019

No description provided.

Copy link

@jingyih jingyih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! We need to make sure maxConcurrentReadTxns is larger than typical value of concurrentReadTxns.

// we can use its data to enforce our limit.
concurrentReadTxns := b.db.Stats().OpenTxN

for i := 0; i < (maxConcurrentReadTxns - concurrentReadTxns); i++ {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to run some simple benchmarks to find out what is the typical value for concurrentReadTxns.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 1 + number of committed reads. Double checked it with a benchmark. Adding a gauge metric to this PR for the concurrentReadTxns value.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we will need to determine what a reasonable limit might be. I'm not 100% convinced that # of concurrent requests is sufficient, got an idea for another approach where we weight requests by their response count.

@jpbetz jpbetz force-pushed the read-txn-limit branch 3 times, most recently from 95567d3 to 36e6c72 Compare February 13, 2019 23:10
@jpbetz
Copy link
Owner Author

jpbetz commented Feb 14, 2019

Merging this for image build. Post-commit reviews still welcome.

@jpbetz jpbetz merged commit c616f7c into expensive_read_instrumentation Feb 14, 2019
jpbetz pushed a commit that referenced this pull request Oct 11, 2019
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

Successfully merging this pull request may close these issues.

2 participants