Limiting CPU for containers

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Limiting CPU for containers


      I'm relatively new to this but I've been searching for a way to do this but I just can't wrap my head around how to.

      I'm using OMV4.x and I have docker installed. In docker I'm running a container with Handbrake, whenever Handbrake does it thing my CPU is running very high and I'm afraid my plex container will suffer from this. What I want to do is to limit handbreak to only run on 2 cores/cpus but I cant seem to get it working.

      I've tried to localize a config-file and what I found was:

      Source Code

      1. root@XX:/var/lib/docker/containers/ace8xxxxx# ls -l
      2. total 936
      3. -rw-r----- 1 root root 913619 Nov 28 19:16 ace8xxxxx-json.log
      4. drwx------ 2 root root 4096 Nov 26 22:18 checkpoints
      5. -rw------- 1 root root 4889 Nov 27 22:48 config.v2.json
      6. -rw-r--r-- 1 root root 1733 Nov 27 22:48 hostconfig.json
      7. -rw-r--r-- 1 root root 13 Nov 27 22:48 hostname
      8. -rw-r--r-- 1 root root 174 Nov 27 22:48 hosts
      9. drwx------ 2 root root 4096 Nov 26 22:18 mounts
      10. -rw-r--r-- 1 root root 174 Nov 27 22:48 resolv.conf
      11. -rw-r--r-- 1 root root 71 Nov 27 22:48 resolv.conf.hash
      Display All
      none of these seems to have anything specifed for CPU pre-written when I checked them out with the nano command and I don't want to wreck my machine. Does anyone have an idea of how and where I can change this? Couldn't find anything on the docker infopage for Handbrake either.
    • You need to add --cpus=2 to the extra options box when creating the container.
      omv 5.1.2 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.1.9 plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!