Skip to content

Limit available parallelism to 1 per 2GB of RAM #725

Open
@riking

Description

@riking

This is a proposed solution to the OOM class of issues mentioned in #589 , in particular the pattern where a large number of integration tests are launched in parallel.

Common CPU-to-RAM ratios for cloud provider VMs are 1:2GB, 1:4GB, and 1:8GB. Because there is currently no parallelism limit imposed, use the most generous ratio for the initial implementation.

Proposed Implementation:

src/runner/test.rs is updated to calculate the total memory available to the nearest limiting control group or whole machine, divide this number by 2 gigabytes and provide the result to parallelism-limiting mechanisms.

Each relevant cargo command accepts -jNUM, but cargo test could also specify --test-threads=NUM for the default test runner to limit its parallelism as well.

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