Skip to content

abnormal memory usage by the grpc packet #34849

@tiancaiamao

Description

@tiancaiamao

Enhancement

Analyzing the memory usage of this case

mysql -h 127.0.0.1 -u root -P 4000  -e 'select * from  (select * from ens_rb001.rb_acct_balance union all select * from ens_rb002.rb_acct_balance union all select * from ens_rb003.rb_acct_balance union all select * from ens_rb004.rb_acct_balance)' > /dev/null

image

Union all on 4 tables, and the default distsql scan concurrency is 15, it means that in in theory, there should be at most 4*15 = 60 inflight packet.

530.16M/3.51M > 150, there are more than 150 packet inuse grpc packet, which is counterintuitive.

It's caused by that we use buffered channel, so even the distsql scan concurrency is 15,
there will be much more packets than the worker count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions