# the problem with balancing in swarm mode

**URL:** <https://community.traefik.io/t/the-problem-with-balancing-in-swarm-mode/22980>\
**Category:** Traefik v3 (latest)\
**Tags:** docker-swarm\
**Created:** [May 30, 2024, 12:04pm UTC](https://community.traefik.io/t/the-problem-with-balancing-in-swarm-mode/22980 "2024-05-30T12:04:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vdert](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@Vdert](https://community.traefik.io/u/Vdert)\
**Post date:** [May 30, 2024, 12:04pm UTC](https://community.traefik.io/t/the-problem-with-balancing-in-swarm-mode/22980/1 "2024-05-30T12:04:18Z")

</div>

Hi, my docker swarm consists of 2 nodes: 1 manager and 1 worker. But the services installed on the worker node do not work. When I go to traffic.\*\*.site, the site works every other time. (it opens 1 time, does not open 2 times, opens 3 times, and so on). Tell me what my mistake is.

```auto
services:
  reverse-proxy:
    image: traefik:v3.0
    ports:
      - "80:80"
    deploy:
      mode: "global"
      placement:
        constraints:
          - "node.role == manager"
      labels:
        - "traefik.http.routers.mydashboard.rule=Host(`traefik.**.site`)"
        - "traefik.http.routers.mydashboard.service=api@internal"
        - "traefik.http.services.mydashboard.loadbalancer.server.port=80"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    command:
      - "--api.insecure=true"
      - "--log.level=DEBUG"
      - "--providers.swarm.endpoint=unix:///var/run/docker.sock"
    networks:
      - proxy
    
  whoami:
    image: "traefik/whoami"
    networks:
      - "proxy"
    deploy:
      mode: "global"
      labels:
        - "traefik.http.routers.whoami.rule=Host(`whoami.**.site`)"
        - "traefik.http.services.whoami-service.loadbalancer.server.port=80"

  web:
    image: nginx
    networks:
      - "proxy"
    deploy:
      mode: "global"
      labels:
        - "traefik.http.routers.webs.rule=Host(`web.**.site`)"
        - "traefik.http.services.webs-service.loadbalancer.server.port=80"

networks:
  proxy:
    name: proxy
    driver: overlay
    attachable: true

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [May 30, 2024, 3:48pm UTC](https://community.traefik.io/t/the-problem-with-balancing-in-swarm-mode/22980/2 "2024-05-30T15:48:02Z")

</div>

Is your overlay network working? Do you use a VLAN/vSwitch? Try a ping with payload \> 1500 bytes between containers on different nodes.

---

<div class="post-metadata">

**Author:** ![Vdert](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@Vdert](https://community.traefik.io/u/Vdert)\
**Post date:** [May 30, 2024, 6:06pm UTC](https://community.traefik.io/t/the-problem-with-balancing-in-swarm-mode/22980/3 "2024-05-30T18:06:35Z")

</div>

Thanks for the advice, I'll try. I don't use VLAN/vSwitch.
