Home > other >  Docker shell script CPU control problem
Docker shell script CPU control problem

Time:09-25

Have a docker container, docker run - it - the name ng1 - cpuset - cpus=0 83 c6614ec077/bin/bash limit can only use the first CPU,

Container up, the process of executing a C, run two process instance, found that the CPU is confined to the first nuclear above,

# include "stdio.h"
Void main ()
{
int sum=0;
Printf (" this is my 1 st contain app \ n ");
While (1) {sum=sum + 1; }
}

But if the container up, to execute a shell script,
While true
Do
Echo "hahahah===="
The done
Found that the CPU is not limited, what reason is this? What's special about a shell script?
  • Related