Swarm’s spread and binpack scheduling strategy, when selecting nodes, does it not obtain the available memory and CPU resources of the system in real time?
I did the following tests:
1. Build a swarm cluster of three docker hosts: node-1, node-2 and node-3. Each docker host has the same configuration, with 4G memory and a 2-core CPU；.
2. Run the CPU of node-1 to full capacity (or consume memory);
3. Create 6 new containers, or will 2 containers be allocated to node-1;
Have you studied it?
After looking at some documents, I couldn’t find the reason, and then I guess it might be
swarmReason for service discovery (I used
DockerHubProvided) because the scheduler filters the node information collected by service discovery.
Replace service discovery with
etcdAfter that, the problem was solved.