is it possible to run process that use only 2 CPU from 16 CPU in my linux machinewe have red-hat machine version 6and we have 16 CPUbut because license cost money and if we limit the script that will run only on 2 CPU then we can save the money 
is it possible to run process that use only 2 CPU from 16 CPU in my linux machine
linux;rhel;process;cpu
You can restrict a process to running on a specific (set of) cores with taskset.taskset 3 mycommand(3 is a bit mask, meaning that mycommand will only run on cores 0 and 1.)However, this won't change how many CPUs the process thinks you have. It's only an instruction to the kernel not to schedule the process on CPUs other than the ones listed in the bit mask. So if the program does a license check based on the number of CPUs, this probably won't help.A solution that would definitely work is to run the process in a virtual machine with only 2 (virtual) cores. However this might cost performance.Cgroups offers an intermediate way of limiting the resources that a process may use. I don't know whether it can effectively hide CPUs from the process or whether it only acts like taskset.