Skip to content

!!!canal.instance.parser.parallelThreadSize #29

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

Open
dyrnq opened this issue Oct 23, 2024 · 0 comments
Open

!!!canal.instance.parser.parallelThreadSize #29

dyrnq opened this issue Oct 23, 2024 · 0 comments

Comments

@dyrnq
Copy link
Owner

dyrnq commented Oct 23, 2024

## concurrent thread number, default 60% available processors, suggest not to exceed Runtime.getRuntime().availableProcessors()
#canal.instance.parser.parallelThreadSize = 16

相关代码

        int tc = parserThreadCount > 0 ? parserThreadCount : 1;
        this.parserExecutor = Executors.newFixedThreadPool(tc, new NamedThreadFactory("MultiStageCoprocessor-Parser-"
                                                                                      + destination));

        this.stageExecutor = Executors.newFixedThreadPool(2, new NamedThreadFactory("MultiStageCoprocessor-other-"
                                                                                    + destination));

假如 canal.instance.parser.parallelThreadSize = 4 如下

docker compose exec -it cs1 bash -c "ps -T -p 1 |grep MultiStage"
      1     292 ?        00:00:00 MultiStageCopro
      1     293 ?        00:00:00 MultiStageCopro
      1     294 ?        00:00:00 MultiStageCopro
      1     295 ?        00:00:00 MultiStageCopro
      1     296 ?        00:00:00 MultiStageCopro
      1     297 ?        00:00:00 MultiStageCopro
 docker compose exec -it cs1 bash -c "pstree -lspat | grep MultiStage"
  |-{MultiStageCopro},292
  |-{MultiStageCopro},293
  |-{MultiStageCopro},294
  |-{MultiStageCopro},295
  |-{MultiStageCopro},296
  |-{MultiStageCopro},297
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

No branches or pull requests

1 participant