Why use cgroup can not restrict cpu resources?

I want to use cgroup to limit CPU resources per group under CentOS 7. I've added two groups in the OS, one of them having a website – Web2, a other group a website – web3, i am this kind of step-by-step command line link. .

access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/resource_management_guide/ch-using_control_groups

1.

yum install libcgroup-tools

2.In the file /etc/cgconfig.conf

client group0 {
CPU {
cpu.shares = "250";
}
cpuacct {
cpuacct.usage = "0";
}
Memory {
memory.limit_in_bytes = "2G";
memory.memsw.limit_in_bytes = "3G";
}
}

customer group1 {
CPU {
cpu.shares = "500";
}
cpuacct {
cpuacct.usage = "0";
}
Memory {
memory.limit_in_bytes = "4G";
memory.memsw.limit_in_bytes = "6G";
}
}

in the file /etc/cgrules.conf

@customer0 cpu, cpuacct, memory client0
@client1 cpu, cpuacct, memory client1

4

service cgconfig restart; service cgred restart

5.in the cpu.sh file

x = 0
while [ True ];make
x = $ x + 1
completed;

I have tested it to use these two command lines:

sudo -u web2 sh /tmp/cpu.sh &
sudo -u web3 sh /tmp/cpu.sh &

It worked, we are twice the other. But in the other way, I wrote a loop code to consume cpu resources and I visited two websites in a browser, then I went into the operating system and type command – top, I see two lines, the command line is php-fpm, the value of the line% cpu is the same, it is incorrect, should be one is twice the other. What's wrong?