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

fix grpc threadpool size #7974

Merged
merged 3 commits into from Jul 2, 2019

Conversation

Projects
None yet
3 participants
@hrfuller
Copy link
Contributor

commented Jun 28, 2019

Problem

The number of grpc completion queues on the host is tied to the requested remote concurrency. The remote concurrency numbers are likely to be much larger than the available cores on the host machine creating thread management overhead on the host.

Solution

Use the built in GRPC EnvBuilder class which picks a sensible number of completion queue / threads based on the host proc count.

Result

The user wont have to worry about strange side effects on the host when increasing remote concurrency.

@stuhood stuhood requested a review from illicitonion Jun 28, 2019

@illicitonion
Copy link
Contributor

left a comment

Seems reasonable - I haven't dug into the underlying C++ here, and it's not super well documented outside the code, but if it starts causing problems we can look at it then... :)

@hrfuller

This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2019

The method grpc uses to get cpu count boils down to reading a /sys file at runtime.

@hrfuller hrfuller force-pushed the twitter:hfuller/fix-grpc-threadpool-size branch from c7ef768 to 8170b87 Jul 1, 2019

@hrfuller

This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2019

Looks like this PR is slightly increasing the memory overhead in one of the pantsd integration tests. Probably lay off merging for now, until I figure out why.

Edit. Though if you have any idea why a few less grpc threads would be causing a memory increase in the daemon across mulitple runs let me know!

@stuhood

stuhood approved these changes Jul 2, 2019

@stuhood stuhood merged commit f28cbb9 into pantsbuild:master Jul 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:hfuller/fix-grpc-threadpool-size branch Jul 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.