Giter VIP home page Giter VIP logo

container-stress's Introduction

container-stress

Docker Image CI Generic badge Generic badge Generic badge Generic badge Generic badge Generic badge

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/ ( 404 :( )

Build Dockerfile

we use alpine as the base image. for build Dockerfile Use:

$ docker build --tag=<DOCKER_IMAGE_NAME_TAG> .

Stress command

stress imposes certain types of compute stress on your system

Usage: stress [OPTION [ARG]] ...
 -?, --help         show this help statement
     --version      show version statement
 -v, --verbose      be verbose
 -q, --quiet        be quiet
 -n, --dry-run      show what would have been done
 -t, --timeout N    timeout after N seconds
     --backoff N    wait factor of N microseconds before work starts
 -c, --cpu N        spawn N workers spinning on sqrt()
 -i, --io N         spawn N workers spinning on sync()
 -m, --vm N         spawn N workers spinning on malloc()/free()
     --vm-bytes B   malloc B bytes per vm worker (default is 256MB)
     --vm-stride B  touch a byte every B bytes (default is 4096)
     --vm-hang N    sleep N secs before free (default none, 0 is inf)
     --vm-keep      redirty memory instead of freeing and reallocating
 -d, --hdd N        spawn N workers spinning on write()/unlink()
     --hdd-bytes B  write B bytes per hdd worker (default is 1GB)

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:

$ docker run --rm -it mohsenmottaghi/container-stress <COMMAND>

or

$ docker run --name stress -idt mohsenmottaghi/container-stress <COMMAND>

Run Stress test on Swarm cluster

For stress test on Swarm cluster, you can use the docker-compose.yml file.

  1. initialize the Swarm cluster or use your current cluster

  2. edit the docker-compose.yml with your specific command and replicas

  3. deploy stress stack with command like this:

    $ docker stack deploy -c docker-compose.yml <STACK_NAME>
    
  4. (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.

$ kubectl apply -f stress-deployment.yml

To check the deployment status:

$ kubectl get deployment container-stress

or check all resources:

$ kubectl get all

To remove deployment:

$ kubectl delete deployment container-stress

or

$ kubectl delete -f stress-deployment.yml

container-stress's People

Contributors

alireza1371 avatar mohsenmottaghi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.