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

*: support memory quota #5524

Merged
merged 2 commits into from Sep 25, 2019
Merged

*: support memory quota #5524

merged 2 commits into from Sep 25, 2019

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Sep 24, 2019

What have you changed?

  • support memory quota
  • fix grpc coredump issue

What is the type of the changes?

  • New features

How is the PR tested?

integration tests

Does this PR affect documentation (docs) or should it be mentioned in the release notes?

Yes.

Does this PR affect tidb-ansible?

Yes.

- support memory quota
- fix grpc coredump issue

Signed-off-by: Jay Lee <busyjaylee@gmail.com>
@BusyJay BusyJay added type/enhancement Type: Issue - Enhancement priority/release-blocker This PR blocks a release. Please review it ASAP. type/changelog Type: PR - Need to be noted in the CHANGELOG labels Sep 24, 2019

- Limit the memory size can be used by gRPC
- Default: unlimited. gRPC usually works well to reclaim memory by itself.
- Limit the memory in case OOM is observed. Note that limit the usage can lead to potential stall.
Copy link
Member

Choose a reason for hiding this comment

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

what is potential stall?

Copy link
Member Author

Choose a reason for hiding this comment

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

Allocation stall. It will not allocate until there are free slots.

Copy link
Member

Choose a reason for hiding this comment

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

If there is no free memory, the connection(Channel) is refused directly. Maybe it should be explained.

## Limit the memory size can be used by gRPC. Default is unlimited.
## gRPC usually works well to reclaim memory by itself. Limit the memory in case OOM
## is observed. Note that limit the usage can lead to potential stall.
# grpc-memory-pool-quota = "32G"
Copy link
Member

Choose a reason for hiding this comment

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

grpc-memory-pool-quota represents the memory usage for each connect. So 32G will it be too large?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think when it's attached to the server, it should be a limit to the memory server uses, not just a single connection. Besides, 32G is just a hint for unlimited.

Copy link
Member

Choose a reason for hiding this comment

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

Fine

@@ -63,6 +63,7 @@ pub struct Config {
pub grpc_compression_type: GrpcCompressionType,
pub grpc_concurrency: usize,
pub grpc_concurrent_stream: i32,
pub grpc_memory_pool_quota: ReadableSize,
Copy link
Member

Choose a reason for hiding this comment

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

why not just use usize just like grpc_concurrency

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it has unit. Values like "32GiB" or "1024MiB" should be valid configuration.

Copy link
Member

Choose a reason for hiding this comment

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

Good Point

@BusyJay BusyJay changed the title *: update grpc *: support memory quota Sep 24, 2019
Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

@AndreMouche AndreMouche added the status/can-merge Status: Can merge to base branch label Sep 25, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 25, 2019

/run-all-tests

@sre-bot sre-bot merged commit 0132968 into tikv:release-3.0 Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This PR blocks a release. Please review it ASAP. status/can-merge Status: Can merge to base branch type/changelog Type: PR - Need to be noted in the CHANGELOG type/enhancement Type: Issue - Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants