root@docker ~]
stress: info: [1] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
[root@docker ~]
top
- 15:20:48 up 1:05, 3
users
, load average: 1.55, 1.13, 0.52
Tasks: 164 total, 3 running, 161 sleeping, 0 stopped, 0 zombie
Cpu(s): 99.0%us, 0.7%sy, 0.0%ni, 0.0%
id
, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
Mem: 3910160k total, 1298324k used, 2611836k
free
, 97924k buffers
Swap: 4194300k total, 0k used, 4194300k
free
, 917480k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4772 root 20 0 7208 124 28 R 49.9 0.0 0:16.12 stress
4144 root 20 0 7208 120 28 R 49.5 0.0 4:22.39 stress
1 root 20 0 19356 1532 1228 S 0.0 0.0 0:01.55 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration
/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd
/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper
/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00.02 watchdog
/0
7 root 20 0 0 0 0 S 0.0 0.0 0:01.66 events
/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events
/0
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_long
/0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_power_ef
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
13 root 20 0 0 0 0 S 0.0 0.0 0:00.03 netns
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async
/mgr
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
16 root 20 0 0 0 0 S 0.0 0.0 0:00.02 sync_supers
17 root 20 0 0 0 0 S 0.0 0.0 0:00.01 bdi-default
然后,可以发现存在两个stress的进程,各占用49.5%
我们再次添加一个容器,并修改下stress权限为1024
[root@docker ~]
top
- 15:22:13 up 1:07, 4
users
, load average: 2.53, 1.50, 0.70
Tasks: 171 total, 4 running, 167 sleeping, 0 stopped, 0 zombie
Cpu(s): 99.3%us, 0.3%sy, 0.0%ni, 0.0%
id
, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
Mem: 3910160k total, 1318152k used, 2592008k
free
, 99008k buffers
Swap: 4194300k total, 0k used, 4194300k
free
, 921024k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4992 root 20 0 7208 120 28 R 49.5 0.0 0:09.79 stress
4144 root 20 0 7208 120 28 R 24.9 0.0 4:59.56 stress
4772 root 20 0 7208 124 28 R 24.6 0.0 0:53.28 stress
1 root 20 0 19356 1532 1228 S 0.0 0.0 0:01.55 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration
/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd
/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper
/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00.02 watchdog
/0
7 root 20 0 0 0 0 S 0.0 0.0 0:01.69 events
/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events
/0
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_long
/0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_power_ef
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
13 root 20 0 0 0 0 S 0.0 0.0 0:00.03 netns
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async
/mgr
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
16 root 20 0 0 0 0 S 0.0 0.0 0:00.02 sync_supers