docker压测工具:
docker pull lorel/docker-stress-ng
docker run —name stress -it —rm -m 256m lorel/docker-stress-ng:latest stress —help #可查看帮助.
docker run —name stress -it —rm -m 256m lorel/docker-stress-ng:latest stress —vm 2 #限制其最多使用256M内存.
docker run —name stress -it —rm —cpus 2 lorel/docker-stress-ng:latest stress —cpu 8 #限制最多使用2个CPU核心的计算资源.
终端1:
docker run —name stress -it —rm —cpu-shares 1024 lorel/docker-stress-ng:latest stress —cpu 8
终端3:
docker run —name stress -it —rm —cpu-shares 512 lorel/docker-stress-ng:latest stress —cpu 8
终端2:
docker top stress #查看容器进程数
docker stats #查看docker资源的消耗情况。