How do I limit the utilization of CPU with cgroups?

Solution Verified - Updated -

Issue

  • A process consume 100% CPU resource, how to limit it with cgroups?

    # dd if=/dev/zero of=/dev/null
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     1549 root      20   0  102m  652  548 R 100.0  0.0   0:08.24 dd    
    

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content