-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Setting default_sni to a value that won't generate a cert can cause memory exhaustion #6835
Comments
Hmm, I'm not really sure what to do about this though. We can't know you made a mistake like that, I don't think... I'm also not really sure what that graph is. What am I looking at? 85 MB memory usage? That's pretty normal when there's traffic. Is there an actual leak? |
I see, so that one function is using 9.8 GB instantaneously (i.e. not cumulatively)? That does seem like a problem... could you grab a profile? https://caddyserver.com/docs/profiling -- heap and goroutine dump would be useful I think. (Did you mean to close this?) |
I have the matching heap and goroutine dump. Are they safe to post? Edit: Nope, didn't mean to close, not sure how I managed that. |
Yeah, profiles are technically safe to share. |
Attached |
Reopened, I had a Github helper extension that is breaking the issue page, my bad. |
Thanks, I'll take a look! |
If
default_sni
is set to a value that can't generate a certificate, it seems Caddy will create many instances of "getCertDuringHandshake" whenever a connection with no valid SNI is made, this never seem to finish and cause increased memory growth until eventually killed by the orchestrator.This was a mis-configuration on my part, I mistakenly deployed a change that led to the HOSTNAME env variable, usually set to the load balancer hostname, becoming set to the docker container id.
With debug logging enabled, the log is flooded with this message.
The text was updated successfully, but these errors were encountered: