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 thread contention in subgraph indexing #937

Closed
Jannis opened this issue May 13, 2019 · 4 comments · Fixed by #1448
Closed

Reduce thread contention in subgraph indexing #937

Jannis opened this issue May 13, 2019 · 4 comments · Fixed by #1448
Labels
enhancement New feature or request p3

Comments

@Jannis
Copy link
Contributor

Jannis commented May 13, 2019

No description provided.

@leoyvens
Copy link
Collaborator

leoyvens commented May 13, 2019

Plan as outlined in #856 (comment):

  • Set the tokio threadpool size to 100.
  • Solve Move slow db interactions to tokio blocking pool #905 by moving all store operations into a separate, blocking threadpool, and have them return futures. This is not hard but it's laborious and will have a big diff.
  • Try going back to the default threadpool size.

leoyvens added a commit that referenced this issue May 14, 2019
I could still observe a small amount of contention
and waiting after this, but it's reduced a lot from before.
Part of  #937.
Jannis pushed a commit that referenced this issue May 15, 2019
I could still observe a small amount of contention
and waiting after this, but it's reduced a lot from before.
Part of  #937.
@leoyvens
Copy link
Collaborator

Since increasing the size I still see 1ms and 10ms contention warnings, but no 100ms which is an improvement, contention seems to have shifted to the DB connection pool which was expected. Still the situation in tokio is not great, probably due to the issue described in tokio-rs/tokio#426 (comment).

@Jannis
Copy link
Contributor Author

Jannis commented Jun 3, 2019

What's the latest here? Didn't we add the blocking threadpool recently?

@leoyvens
Copy link
Collaborator

leoyvens commented Jun 3, 2019

I believe we've sufficiently mitigated this issue that it shouldn't have any practical effect, but the solution is not ideal, so I'd like to keep this open. My explanation for the thread pool contention warnings that can still be observed sometimes is that half of them are due do this crossbeam bug (fix isn't released yet) and the other half is simply that there is contention for the CPUs, I haven't confirmed this yet, but it would be an ops concern, so I'm removing the label from this issue.

@leoyvens leoyvens added the p3 label Aug 30, 2019
@leoyvens leoyvens removed their assignment Oct 6, 2019
@Jannis Jannis added the enhancement New feature or request label Nov 11, 2019 — with Leander Project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants