# Traefik - High CPU usage in high load

**URL:** <https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [May 23, 2023, 2:53pm UTC](https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716 "2023-05-23T14:53:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sneycampos](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sneycampos/32/7147_2.png) [@sneycampos](https://community.traefik.io/u/sneycampos)\
**Post date:** [May 23, 2023, 2:53pm UTC](https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716/1 "2023-05-23T14:53:25Z")

</div>

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?

```auto
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"

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/b291628ee69e73da5134b054b8d7341007684baf.png)

---

<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 23, 2023, 8:51pm UTC](https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716/2 "2023-05-23T20:51:15Z")

</div>

This was asked recently and a lot of overhead was created by writing debug and access log.

---

<div class="post-metadata">

**Author:** ![sneycampos](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sneycampos/32/7147_2.png) [@sneycampos](https://community.traefik.io/u/sneycampos)\
**Post date:** [May 24, 2023, 5:55pm UTC](https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716/3 "2023-05-24T17:55:27Z")

</div>

Can you help sharing some of these posts?

---

<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 24, 2023, 7:16pm UTC](https://community.traefik.io/t/traefik-high-cpu-usage-in-high-load/18716/4 "2023-05-24T19:16:50Z")

</div>

I meant this one

> [@High memory usage during DoS](https://community.traefik.io/t/high-memory-usage-during-dos/16640):
>
> During DDoS traefik (it's happening with 2.6.x, 2.8.x, and now even with 2.9.5) starts consuming memory and eventually is OOMKilled. About 14k req/s ends with consuming about 16GB RAM. How can I check why it is consuming memory so much?
