Container Stress
important
The repository of this docs is on GitHub https://github.com/mohsenmottaghi/container-stress
caution
This docs is not ready
container-stress
This is Stress test for container environments. This project work base on stress you can access the source on this link: https://people.seas.harvard.edu/~apw/stress/
Build Dockerfile
we use alpine as the base image. for build Dockerfile Use:
Stress command
stress imposes certain types of compute stress on your system
Example:
stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
Note: Numbers may be suffixed with s,m,h,d,y (time) or B,K,M,G (size).
stress command examples :
Command |
---|
stress --verbose --vm 1 --vm-bytes 256M |
stress --verbose --vm 1 --vm-bytes 256M |
stress --verbose --vm 1 --vm-bytes 512M |
stress --verbose --vm 1 --vm-bytes 1024M |
stress --verbose --vm 2 --vm-bytes 256M |
stress --verbose --vm 2 --vm-bytes 512M |
stress --verbose --vm 2 --vm-bytes 1024M |
Run Stress test on single docker host
For test on single docker host you can use this command:
or
Run Stress test on Swarm cluster
For stress test on Swarm cluster, you can use the docker-compose.yml file.
initialize the Swarm cluster or use your current cluster
edit the docker-compose.yml with your specific command and replicas
deploy stress stack with command like this:
$ docker stack deploy -c docker-compose.yml <STACK_NAME>(Optional) you can use Docker viualizer
$ docker service create \--name=viz \--publish=8080:8080/tcp \--constraint=node.role==manager \--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \dockersamples/visualizer
Run Stress test on Kubernetes Cluster
For stress test on kubernetes cluster, you need to deploy the Deployment yaml
file.
To check the deployment status:
or check all resources:
To remove deployment:
or