Option to specify cpu number for docker container?


#1

Hi,

For some analysis, the R code I’m using takes advantage of multiple cores. I’m wondering if there is an option I can use to specify how many cores an app’s container can use?

Thanks


#2

Ok, I guess the docker container has the ability to make use of all the cores that the host has. so in docker run command we should limit the number of resources it can access. So the question should be can we access that option from shinyproxy?


#3

Hi @Keqiang_Li,

Can you specify what would be useful for you? Is it the --cpus option to docker run or the --cpuset-cpus option?

https://docs.docker.com/engine/admin/resource_constraints/#cpu

Best,
Tobias


#4

I’m sorry for the late reply. My original goal is to enable multiple core access for docker container and found that’s the default behavior. I don’t find limiting the number of CPUs too useful for me now. I’ll come back to this thread if I find it’s necessary. Thanks!