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

hrfuller
Copy link
Member

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.

Copy link
Contributor

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

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
Copy link
Member Author

hrfuller 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 hfuller/fix-grpc-threadpool-size branch from c7ef768 to 8170b87 Compare July 1, 2019 17:20
@hrfuller
Copy link
Member Author

hrfuller 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 merged commit f28cbb9 into pantsbuild:master Jul 2, 2019
@stuhood stuhood deleted the hfuller/fix-grpc-threadpool-size branch July 2, 2019 01:43
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.

None yet

3 participants