Control groups (cgroups)
cgroups (control groups) measure and limit CPU, memory and I/O for a group of processes. "Namespaces" is the tempting answer, but namespaces control what a process can see (PIDs, network, mounts). They do not control how much it can use.
Read more