title: How to restrict cpu usage from host to docker container
body: <p>I have one VM host in one physical server with many docker containers inside.</p>
  
  <p>Here one fragment of my fig.yml</p>
  
  <pre><code>pg:
    image: pg...
  redis:
    image: redis...
  mongodb:
    image: mongodb...
  app:
    image: myapp...
  </code></pre>
  
  <p>I wish set <strong>pg</strong> container use only 25% of host cpu and <strong>app</strong> use only 50% of host cpu and so on. </p>
  
  <p>Could I do it with <code>fig</code> or with <code>docker run</code> and manage link by hand?</p>
  
  <p>In my case when one of this container is running a costly task it affect the cpu performance of the others ones. But when in the same physical server I have others VM with similar deploy inside the problem increase dramatically.</p>