Welcome to the Linux Foundation Forum!

Lab4.3 content inaccurancy

Step 12 at Exercise 4.3: "Resource Limits for a Namespace" describes a top command output that is equal for both default and low-usage-limit namespace. But hog deployment prepared in lab 4.2 is configured to consume 2 cpus. So in limited namespace stress container really consumes 100 cpu (in top) as it limited by namespace. But default namespaced hog container actually consumes 200 cpu (in top) as expected, isn't it?

Answers

  • Posts: 2,451
    edited April 21

    Hi @lioneyes,

    The hog deployment from lab exercise 4.2 is allowed to consume close to 100% CPU, per the CPU limit (1) defined in the manifest. This reading is consistent with a node/VM with 2 CPU cores.

    The hog deployment from lab exercise 4.3 is restricted by the limitrange CPU limit (1) set on the newly created namespace, therefore the reading is also close to 100%. This reading is also consistent with a node/VM with 2 CPU cores.

    Are your top readings different?

    Regards,
    -Chris

  • Posts: 3

    I forgot to add "cpu: 1" into hog's manifest limits map...
    So it consumes 200% cpu as requested in args section for unlimited namespace and it consumes 100% cpu in limited one as expected with such a limit range policy.

    So it was my mistake and a good lesson about how limits work)

    p.s. my manifest for better understanding

    1. resources:
    2. limits:
    3. memory: "4Gi"
    4. requests:
    5. memory: "2500Mi"
    6. args:
    7. - -cpus
    8. - "2"
    9. - -mem-total
    10. - "950Mi"
    11. - -mem-alloc-size
    12. - "100Mi"
    13. - -mem-alloc-sleep
    14. - "1s"

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training