Way to determine resource used by docker executor

We are building an job using Docker executor for yocto build which are resource intensive with resource class : Medium.
We noticed that build is taking too much time to complete. We want to know how we can monitor how much resources of docker executor is used by build before increasing our resource class

Hello @siva-nadipeneni-ext - Thank you for continuing to participate in our community!

At this time, it is possible to only track memory utilization in a build. To do so, you can add the following command to your build receive memory utilization at the job level.

- run:
    command: cat /sys/fs/cgroup/memory/memory.max_usage_in_bytes
    when: always

Additionally, you can track memory usage over time if you add this as the first step of your job:

- run:
    command: |
      while true; do
        sleep 5
        ps auxwwf
        echo "======"
    background: true

For your reference, this information is also located in this Support Article.

I hope this helps!

1 Like

Hello @siva-nadipeneni-ext - One more thing to add. This past week one of my colleagues here in Support, @mike, created an Orb to track CPU usage in a docker build. If you would like to try this, the orb you would need to Opt-in to use of third-party orbs on your organization’s Security settings page.

If can learn more about this Orb here: https://circleci.com/orbs/registry/orb/mkly/docker-cpu-profiling