I am trying traefik in a service that have high traffic load and when i'm testing in benchmarks (WRK) i see traefik using a lot of CPU. Sometimes it uses 50%+ (2cpu)
Without traefik, benchmarking direct to IP i got 800 req/s
With traefik, benchmarking to https domain i got 500 req/s
any tip?
version: '3.7'
services:
events:
container_name: events
image: my-ecr-repository:tag
env_file:
- .env
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.events.rule=Host(`my.domain.com`)"
- "traefik.http.routers.events.entrypoints=web"
- "traefik.http.routers.events.entrypoints=websecure"
- "traefik.http.services.events.loadbalancer.server.port=8181"
- "traefik.http.routers.events.tls.certresolver=myresolver"
traefik:
image: "traefik:v2.10"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=false"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.address=:80"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=me@email.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "443:443"
- "80:80"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"