-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic Auth causes Caddy to use an extraordinary amount of CPU while viewing the NetData Dashboard #4267
Comments
That's a very old version. Please use v2.4.3. The fix to basicauth performance landed in v2.1.0. You're using an older version than that. |
@francislavoie I am using the official Caddy docker image. Docker Hub says that docker-compose.yml
root@node01:/opt/netdata# docker exec caddy caddy version
v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q= |
|
Good to know, thank you. I might suggest that the documentation on docker hub make this clear. As you can see, it states that I will update the docker image and then update with my results here. Thanks again! |
Just a quick update, updating to the latest caddy version does indeed resolve this issue. Thank you so much for the clarification. I highly recommend making this clear on docker hub. In my experience the |
That documentation is auto-generated by Docker's tooling. We can't change it. If you use a shared tag, then it's up to you, the user, to run Using |
If you pull
It's a risk trade off that I am willing to take. I am not a business running a production environment. I need to stay up to date with minimal input from me. EDIT: I suppose it might be wise to pin the major version at least. |
We don't tag |
Okay, I appreciate your help in identifying what was wrong. I am very happy with the basic auth performance now. |
@powerman Could you please open an issue and fill out this bug report template? It will help us identify whether it is a bug or simply a configuration issue. Template
Instructions -- please heed otherwise we cannot help you (help us help you!)
Example of a tutorial: Create a config file: |
Environment
Operating System
OS: Ubuntu 20.04.2 LTS
CPU: 8 Cores
RAM: 8 GB RAM
Swap: 4 GB Swap
Disk: 160 GB NVMe SSD
Applications
Caddy: v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q=
NetData: v1.31.0
Configuration
Caddy - Caddyfile
NetData - netdata.conf
Summary
Caddy will use extreme amounts of CPU usage when you enable basic auth and have many requests being made. In my case, CPU usage spikes to 75%-100% while I am viewing the NetData Dashboard. I can only assume that this has to do with the overhead of the bcrypt algorithm plus many metrics being updated in the dashboard in real time.
I had assumed that this was resolved with commit cc81de9 which resolved issue #3462, but it appears that this is still a major issue with basic auth.
Workarounds
I can work around this issue by lowering the frequency that metrics are collected. For example, updating the dashboard every 5 seconds instead of every 1 second. However, there is still a massive CPU spike when the data is finally sent.
Disabling basic auth completely resolves this issue, but isn't a viable solution for many.
Switching to another web server such as nginx also resolves this issue.
Screenshots
Basic Auth Disabled
Basic Auth Enabled
The text was updated successfully, but these errors were encountered: