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

High cpu usage with slice malloc and mallocGC #1853

Closed
amyangfei opened this issue May 26, 2021 · 0 comments
Closed

High cpu usage with slice malloc and mallocGC #1853

amyangfei opened this issue May 26, 2021 · 0 comments
Labels
area/ticdc Issues or PRs related to TiCDC. type/bug The issue is confirmed as a bug.

Comments

@amyangfei
Copy link
Contributor

amyangfei commented May 26, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

    1. running a TiCDC cluster, with 2 changefeeds, one is 32 tables, the other is 105 tables.
    2. use sysbench workload in upstream, with 250tps/1500qps of each changefeed
    3. observe cpu usage
  2. What did you expect to see?

    normal cpu profile

  3. What did you see instead?

    From cpu profile, we found high cpu usage in the slice malloc/gc of sorter.(*heapSorter).flush

Screen Shot 2021-05-26 at 22 27 51

profile files:

before:
cpu.profile.zip

after:
cpu.profile.2.zip

  1. Versions of the cluster

    • TiCDC version (execute cdc version):

      master@43e6752791f8f09706a4b29a54a5b2250bd9d2fa

  2. workaround

    • After simple change the default slice capacity from 65536 to 16/32, the cpu usage decreases largely

Screen Shot 2021-05-26 at 22 33 00

  • Besides, we can use a double buffer slice to save memory alloc and dealloc, but we should process with memory more careful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants