0

On my MacBook Pro I have 8 performance cores with 2 efficiency cores. So I have 10 cores total. In my Docker Desktop configuration I can choose how many cores are allocated for use of Docker. Is there guidance on how many cores I should give to it? I do builds in the containers, so being able to pass higher -j values is helpful. I currently have Docker configured for 8 of my 10 cores. 10 would probably be better for my dev work, but is assigning all cores not advisable? I can't find guidance or heuristics on choosing this on a Mac host.

firebush
  • 335
  • 1
  • 3
  • 10
  • On Intels with Hyperthreading, the 'fastest, most powerful' method was to assign the number of real cores you have, which HT would then be able to give 'equal terms' to each machine, real & virtual. That would let me run a compile or video transcode at full speed in the VM whilst the rest of my work went unhindered. I don't know how this translates to Apple Silicon. – Tetsujin Jun 23 '23 at 15:57
  • This is something each person will need to tune for themselves as your dev work is undoubtedly different from other people's. Start with 8 cores and if you find you're not fully utilizing them and/or you no longer have enough on your host, re-tweak. – Allan Jun 23 '23 at 16:20
  • @Allan: that actually motivates my post. I'd like to re-tweak things to all 10 cores to add more effective threads for my builds, but I'm wondering whether that is ill-advised because the host may have issues. I suppose I should assume the host can take care of itself and utilize whatever compute is needed to run adequately? – firebush Jun 23 '23 at 17:07
  • 1
    That’s more of a limit to the VM/container. You don’t take away cores from the host, just give access to cores to the container. If you find the host isn’t capable of sustaining your (non docker) workload, you reduce the CPU count and frequency assigned to the container(s) as needed – Allan Jun 23 '23 at 17:16
  • That makes sense. Thank you @Allan. I have a fact been running Docker UI with all 10 cores made available to it and I have been having no problems on the host. – firebush Jun 27 '23 at 04:26
  • Write up your findings as an answer so others can learn from it. Ping me again and I’ll up vote! – Allan Jun 27 '23 at 13:43
  • Actually, why don't you add an answer and get the credit for it. I'll accept it. – firebush Jun 30 '23 at 00:44

0 Answers0