Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

[LEOP-154]set cpu count by provide an env var from external to create correct workers number #51

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

SophiaChen2021
Copy link

@SophiaChen2021 SophiaChen2021 commented Aug 30, 2021

We have observed that scripts that spin up worker processes use os.cpus.length() to determine the number of available CPU cores.
When this is used within a docker container, the os.cpus.length() returns the number of cpu cores the host has, not the container.
Hence many more workers are spawned (in our tests 43 workers when we have only 8 cores) which impacts performance.
so we should set the CPU number as a static value when run in a docker container to avoid impacting our pipeline performance.

reference: LEOP-154
Doc: The impact to our pipeline by spinning up lots more workers than cpus

@SophiaChen2021 SophiaChen2021 changed the title [LEOP-154]set cpu count by env var from external to create correct workers number [LEOP-154]set cpu count by provide an env var from external to create correct workers number Aug 30, 2021
Copy link

@anambl anambl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@georgegillams georgegillams merged commit 2791a2b into Skyscanner:main Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants