Super high CPU load running docker traefik on Digital Ocean -

So perhaps this isn't the correct location to ask this question, but I have 1 Digital Ocean Droplet Running Ubuntu 20.04 with 2vCPU 4Gb RAM and 60Gb Disk Space

As a simple test I am running docker with the only container as traefik since I'd like to use this as my reverse proxy. The only thing I have active on the traefik container is the dashboard.

Without any containers started (docker daemon is running) the CPU load idles around 3-6% on each CPU. Upon starting traefik, the load will shoot up for a second but then idle about the same level. Upon trying to access the dashboard however - both virtual CPU loads will be registered at 100% with CPU % in htop showing 187% load:

It takes forever to load the dashboard, to the point its like unusable. Frankly its awful

I ran some internal testing to see why the performance was so terrible

I initially started the container with these parameters (as defined in the docker compose file):

- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.usersfile=/etc/traefik/basicauth.pass"

and within the /etc/traefik.yml static configuration file I had:

api:
  insecure: false
  dashboard: true

The peformance was awful. If however I set the api insecure to true and restarted container without the authentication mechanism the performance improved dramatically.

Which got my wondering about this entire authentication scheme which I thought honestly was only for the login process.

Does using basic authentication supposed to bring the system to a crawl? Is my DO droplett markedly underpowered?

I've run traefik on homelab server within UbuntuVM (TrueNAS) and I don't experience any high load with the dashboard running. In comparison this DO Droplet is awful in terms of performance.

It is hard to explain the behavior you experience without further debugging. However, can you please try to use the latest Traefik version 2.6.1 and test it with a very basic configuration?

For your further reference, the latest release includes some of the crucial changes concerning resources consumption.

I did manage to track down the error, and honestly I find it weird. For the dashboard I had constructed a basic authentication mechanism (as shown above), but somehow the format of the basicauth.pass file was incorrect.

I believe I first generated the password via:
htpasswd -cB -C 17 basicauth.pass admin

But then later used:
echo $(htpasswd -nbB admin "pass") | sed -e s/\$/\$\$/g

And then just later used a script file to generate the password.

Clearly I wasn't generating credentials correctly so that was my problem -- what I didn't expect however was for this small error to basically consume the entire load of the VM to the point that I basically had to restart the VM to be able to drop the load.

It seems like there would be some error checking on the part of traefik to prevent this problem.