Skip to content

low performance problem in the RoundRobinHandle #37343

Open
@yunnysunny

Description

@yunnysunny
  • Version: 12.20.1
  • Platform: Linux VM-10-6-16-42-17-191 3.10.0-957.12.1.el7.x86_64 deps: update openssl to 1.0.1j #1 SMP Mon Apr 29 14:59:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: docker centos 7

What steps will reproduce the bug?

When there are many new tcp handle send to the master process, it first save it in internal array, and find a free worker process to send to. But there is a low performance problem in the RoundRobinHandle. When the array's length exceeds a certain value, the master process would busy to call shift function of array, its CPU percentage will raise up to 100%, but the children workers have low CPU usages in the other hand.

I have generated a CPU flame graph as follows:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    clusterIssues and PRs related to the cluster subsystem.performanceIssues and PRs related to the performance of Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions