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

Replace pool with single gRPC client #88

Merged
merged 1 commit into from
Jan 15, 2020
Merged

Conversation

palkan
Copy link
Member

@palkan palkan commented Jan 14, 2020

Improve gRPC performance and stability by getting rid of the connections pool in favor of the built-in streaming and multiplexing provided by the grpc package.

Benchmarks show that using a single client result in less errors and slightly better performance than using a pool.

Also, retry mechanism has been also improved to handle exhausted and unavailable errors differently: when we receive ResourceExhausted we try to re-run the request almost immediately. The reason is that we assume that the concurrency settings for the client and the server are similar (though not equal, see below), thus, there could not be real exhaustion but the lag in server implementation (it looks like the worker is returned to the pool after the request completed, so there is a little gap).

For the same reason we set (and recommend setting) the default concurrency for RPC client to be a slightly less than the number of workers in the server (the corresponding defaults are 28 < 30).

@palkan palkan force-pushed the refactor/drop-rpc-pool branch from 1c166e2 to 9b4a9e8 Compare January 14, 2020 23:59
@palkan palkan merged commit c366034 into 1.0-dev Jan 15, 2020
@palkan palkan deleted the refactor/drop-rpc-pool branch January 15, 2020 00:12
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.

1 participant