Skip to content

Default worker thread number is the amount of HW threads, not the cpuset size. #5976

@ipuustin

Description

@ipuustin

Title: Default worker thread number is the amount of HW threads, not the cpuset size.

Description:
If --concurrency option is not specified, the default number of worker threads depends on the number of HW threads in the system. However, this number can be overly large, if Envoy is run in an environment where the allowed cpuset is small. The original intent seems to be that the number of worker threads should scale linearly with the available CPUs.

For example, if Envoy is started in a Docker container like this, Envoy can run only on four CPU cores:

$ docker run --cpuset-cpus="0-3" envoy-container

However, on a server with two physical cores with twenty cores each and hyperthreading enabled, 80 worker threads are started. If Envoy checked the assigned cpuset size, it would be clear that only four CPU cores are assigned to Envoy. It might make more sense then to start only four worker threads.

There's an associated PR #5975 for a possible fix for the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    design proposalNeeds design doc/proposal before implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions