Skip to content

ECS Fargate CPU usage calculated incorrectly? #6

@marksumm

Description

@marksumm

I did some experiments running instances of containerstack/cpustress in ECS Fargate on Linux with a task CPU limit of 1 vCPU (1024 shares). The instances were configured to always use 100% of the available CPU resources, by running with arguments --cpu=2 to start 2 worker threads and --timeout=86400 to prevent early termination. I've noticed some strange behaviour from the exporter...

  1. ecs_task_cpu_limit is returned correctly in CPU shares (1024)

  2. ecs_task_cpu_usage_ratio is correctly scaled between 0 and 1 when exported_container_name="task"

  3. ecs_task_cpu_usage_ratio is returned in CPU shares and not scaled between 0 and 1 when exported_container_name != "task". Also, it seems to be out by a factor of 2.

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