Docker-machine specifies the number of cpus

  docker

Order

A service pressure test on this machine showed that the qps could not reach 10,000 in half a day, and it often ran full of cpu. After half a day, it was found that there was only 1 core and 1 gigabyte of memory in docker. Originally boot2docker allocated 1 cpu and 1G memory to docker-machine by default.

Modify configuration

docker-machine create \
  --driver virtualbox \
  --virtualbox-cpu-count 4 \
  --virtualbox-memory 1024 \
  dev

Or modify it directly in visualbox

Install htop

apt-get update
apt-get install htop

Pressure measurement

ab -c 1000 -n 15000 -r http://192.168.99.100:8080/hello

At the same time, check the cpu and memory for pressure measurement, then adjust ab parameters more, observe and take out reasonable values.

doc