Public Repository

Last pushed: 6 months ago
Short Description
A web service to simulate latency to test long latency operation, e.g.,swarm scale down behavior.
Full Description
  1. docker-compose.yml
    version: "3"

    services:
    long-latency:

     image: shengli/long-latency
     ports:
       - 6101:8080
     networks:
       - long-latency-network
    

    networks:
    long-latency-network:

  2. desc: test docker shutdown behaviour
    a) normal scenario: load balancer
    terminal S1.

       cd deployment
       docker deploy -c docker-compose.yml X
       docker service scale X_long-latency=2
    

    terminal T1. backend will delay 300 seconds

       curl 10.220.209.132:6101/300
       Note: To simply test load balancer, you can use "10.220.209.132:6101" (no /300) which will return immediately.
    

    terminal T2.

       curl 10.220.209.132:6101/300
    

    terminal M1.

       docker service logs -f X_long-latency
           X_long-latency.1.us2yfg8nio3l@n141    | 2017-03-07 13:34:22.181  INFO 6 --- [nio-8080-exec-6] com.dex.Application  : Handlding(seconds): 80/300, step 10s
           X_long-latency.2.e3zrwez2djuv@ubuntu-dev    | 2017-03-07 13:34:28.030  INFO 7 --- [nio-8080-exec-2] com.dex.Application : Handlding(seconds): 90/300, step 10s
           X_long-latency.1.us2yfg8nio3l@n141    | 2017-03-07 13:34:32.182  INFO 6 --- [nio-8080-exec-6] com.dex.Application : Handlding(seconds): 90/300, step 10s
           X_long-latency.2.e3zrwez2djuv@ubuntu-dev    | 2017-03-07 13:34:38.030  INFO 7 --- [nio-8080-exec-2] com.dex.Application : Handlding(seconds): 100/300, step 10s
    

    b) scale container from 2 to 1, this will shutdown one container
    terminal S1.

       cd deployment
       docker service scale X_long-latency=1
    

    Observation: container is forcely shutdown during "docker service scale"

         curl: (52) Empty reply from server
    
Docker Pull Command
Owner
shengli

Comments (0)