Sign inSign up

davidw135/reference-app

By davidw135

Updated about 8 years ago

A network load tool

Image
0

100K+

davidw135/reference-app repository overview

docker-compose.yml

version: "3.1"

services:
    controller:
        image: davidw135/reference-app:0.2
        command: --mode=controller
        networks:
            - ref-app-net
        ports:
            - "8088:8080"
    worker:
        depends_on:
            - controller
        image: davidw135/reference-app:0.2
        command: --mode=worker
        networks:
            - ref-app-net
        deploy:
            replicas: 2
networks:
    ref-app-net:
        driver: overlay

Deploy: docker stack deploy --compose-file docker-compose.yml ref-app

Add workers: each worker will send HTTP POST messages to every other worker. docker service scale ref-app_worker=5

Watch the action: docker service logs ref-app_worker

Adjust the size of the HTTP POST messages and their frequency:

curl \
  -i \
  -H content-type:application/json \
  -X POST \
  -d '{ "pps": 1, "kbytes": 100 }' \
  http://localhost:8088/spec

Where:

'pps' is Packets Per Second. Every worker will send a HTTP POST message to every other worker this many times per second.

'kbytes' is the size of the message they will send.

Tag summary

Content type

Image

Digest

Size

4.8 MB

Last updated

over 8 years ago

docker pull davidw135/reference-app:0.4