TeamSpeak Config - High Package Loss

Hey,

here is my config:

version: "3.7"

services:
  traefik:
    image: traefik
    container_name: traefik
    restart: always
    command:
      #- "--log.level=DEBUG"
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --entrypoints.teamspeak.address=:9987/udp
      - --entrypoints.teamspeak_serverquery_raw.address=:10011
      - --entrypoints.teamspeak_serverquery_ssh.address=:10022
      - --entrypoints.teamspeak_filetransfer.address=:30033
      - --providers.docker
      - --api
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      #- "--certificatesresolvers.mytlschallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
      - "--certificatesresolvers.mytlschallenge.acme.email=redacted"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    labels:
      # Dashboard
      - "traefik.http.routers.traefik.rule=Host(`redacted`)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.routers.traefik.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.middlewares=authtraefik"
      - "traefik.http.middlewares.authtraefik.basicauth.users=admin:redacted"
      # global redirect to https
      - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.redirs.entrypoints=web"
      - "traefik.http.routers.redirs.middlewares=redirect-to-https"
      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
    ports:
      - 80:80
      - 443:443
      - 9987:9987/udp
      - 10011:10011
      - 10022:10022
      - 30033:30033
    networks:
      - web
      - internal
    volumes:
      - "/home/root/traefik/acme.json:/letsencrypt/acme.json"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  teamspeak:
    image: teamspeak
    container_name: teamspeak
    restart: always
    networks:
      internal:
        aliases:
          - teamspeak.docker.local
    volumes:
      - teamspeak:/var/ts3server
    environment:
      - TS3SERVER_LICENSE=accept
      - TS3SERVER_QUERY_PROTOCOLS=ssh,raw
      - TS3SERVER_DB_PLUGIN=ts3db_mariadb
      - TS3SERVER_DB_SQLCREATEPATH=create_mariadb
      - TS3SERVER_DB_HOST=teamspeakdb
      - TS3SERVER_DB_USER=root
      - "TS3SERVER_DB_PASSWORD=redacted"
      - TS3SERVER_DB_NAME=teamspeak
      - TS3SERVER_DB_WAITUNTILREADY=30
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_web"
      - "traefik.http.routers.teamspeak.rule=Host(`ts.redacted`)"
      - "traefik.http.routers.teamspeak.entrypoints=websecure"
      - "traefik.http.routers.teamspeak.tls.certresolver=mytlschallenge"
      # UDP
      - "traefik.udp.routers.teamspeak.entrypoints=teamspeak"
      # Filetransfer
      - "traefik.tcp.routers.teamspeak-filetransfer.entrypoints=teamspeak_filetransfer"
      - "traefik.tcp.routers.teamspeak-filetransfer.rule=HostSNI(`*`)"
      - "traefik.tcp.routers.teamspeak-filetransfer.service=teamspeak-filetransfer@docker"
      # RAW Query
      - "traefik.tcp.routers.teamspeak-serverquery-raw.entrypoints=teamspeak_serverquery_raw"
      - "traefik.tcp.routers.teamspeak-serverquery-raw.rule=HostSNI(`*`)"
      - "traefik.tcp.routers.teamspeak-serverquery-raw.service=teamspeak-serverquery-raw@docker"
      # SSH Query
      - "traefik.tcp.routers.teamspeak-serverquery-ssh.entrypoints=teamspeak_serverquery_ssh"
      - "traefik.tcp.routers.teamspeak-serverquery-ssh.rule=HostSNI(`*`)"
      - "traefik.tcp.routers.teamspeak-serverquery-ssh.service=teamspeak-serverquery-ssh@docker"
      # Services
      - "traefik.udp.services.teamspeak.loadbalancer.server.port=9987"
      - "traefik.tcp.services.teamspeak-filetransfer.loadbalancer.server.port=30033"
      - "traefik.tcp.services.teamspeak-serverquery-raw.loadBalancer.server.port=10011"
      - "traefik.tcp.services.teamspeak-serverquery-ssh.loadBalancer.server.port=10022"
    depends_on:
      - teamspeakdb

  teamspeakdb:
    image: mariadb
    container_name: teamspeakdb
    restart: always
    volumes:
      - teamspeakdb:/var/lib/mysql
    labels:
      - "traefik.enable=false"
    networks:
      - internal
    environment:
      - "MYSQL_ROOT_PASSWORD=redacted"
      - MYSQL_DATABASE=teamspeak

networks:
  web:
    external: true
  internal:
    external: false

volumes:
  teamspeak:

  teamspeakdb:

TeamSpeak is working with Traefik :rocket:
However the Package Loss is pretty high (around 20% - 60%). Do you guys have an idea how to improve this?
I saw that I set a loadbalancer with one server. Is it possible to set a direct connetion?

Hi Sven,
I do have the exact same problem. I was also not able to find a solution for this. Hopefully containous sees this and looks into a fix.
Kind regards
Sharknoon

Tested today for 20 minute now version V2.3.6 seems correct leak of memory for UDP routers and now teampseak run fine behind traefik without packet loss.

One thing change too, rule host SNI are no more compatible with udp routers.

Regards

Hi

I don't understand why you define a http router for teamspeak :thinking:

I'm running a teamspeak server behind traefik since traefik handle TCP and UDP with around 15 users without any packet loss, with this config (not exposing the query here) :

label on service :

      labels:
            - "traefik.enable=true"
            #tcp
            - "traefik.tcp.routers.teamspeaktcp.entrypoints=tstcp"
            - "traefik.tcp.routers.teamspeaktcp.service=teamspeaktcp"
            - "traefik.tcp.routers.teamspeaktcp.rule=HostSNI(`*`)"
            - "traefik.tcp.services.teamspeaktcp.loadbalancer.server.port=30033"
            #udp
            - "traefik.udp.routers.teamspeakudp.entrypoints=tsudp"
            - "traefik.udp.routers.teamspeakudp.service=teamspeakudp"
            - "traefik.udp.services.teamspeakudp.loadbalancer.server.port=9987"

and traefik.toml :

[entryPoints]
  [entryPoints.tstcp]
    address = ":30033"
  [entryPoints.tsudp]
    address = ":9999/udp"

(I'm using a SRV DNS record to redirect my users to the good port so they just need to connect to ts.domain.com.)

Hope this help

Nice to see that it works with traefik because I have only a direct docker container becuase from what I know is that traefik can't open port ranges or is it possible now?

The thing is, that I have a few servers running where at last two of them have SRV Records but all other don't. So my problem is how to setup traefik correctly so that I can simply expand the port range but each user gets connected to the correct TS-Instance?

One toled me for each port one loadbalancer but is this true? Is 9987 not enough since you can use TLD:PORT or what am I missing maybe here?

For the setup:

Default Ports for SQ and default TS, only the FT-Port was changed becuase my host is blocking this port. In addition a port range from 100 ports to available to not have to restart the container every time a new server is created which needs a new port and a new addition into the traefik conf.

Would nice if the solution is maybe a simple one ^^