Skip to content

Binlog parser with high cpu usage #1063

@hjweddie

Description

@hjweddie

I have a binlog analyzer process for MySQL 8.0 with zstd compressed binlog. My analyzer suffered from much heavy cpu usage. After I got pprof graph, I can find that zstd.NewReader created much gc load.
My process had many network IO bound jobs with GOMAXPROCS setted to 198. I think zstd.WithDecoderConcurrency(0) may lead to call zstd.newBlockDec and zstd.newFrameDec many times (198) for every transaction_payload_event with heavy gc load.

code

My question is could we add functions for user to offers value for zstd.WithDecoderConcurrency (for TransactionPayloadEvent or BinlogSyncer ?) ? Or do you have any better solution/advice ?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions