-
Notifications
You must be signed in to change notification settings - Fork 824
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
Performance concerns #1147
Comments
To be more specific it handles certificate by reverse container creation time. Maybe the ability to reload nginx as soon as a certificate is created or renewed rather that at the end of the loop could help ?
I'm not sure I understand this, could you elaborate ?
That would be a major rework of the container logic and inner working. While the idea is interesting, I'll be honest: that's clearly not planned at the moment or on foreseeable future, and neither is implementing queue management. |
Yes definitely, I guess this the easiest fix to drastically improve the performance feeling.
This is related to the idea which states that ideally only certificates that are related to docker events should be checked for renewal. This ensures that certificates related to containers that didn't trigger an event continues to be refreshed regularly. |
I'll check docker-gen code to be sure but I don't think that's possible, from memory there is no notion of container(s) being related to a given docker event that docker-gen currently have access to. Even if this was available, I don't think this could be used by acme-companion given the way it work. Each time docker-gen re-generate You can view it kinda like using Terraform: on each Docker event docker-gen render a declarative configuration file describing the wanted certificate configuration at this point in time, and the acme-companion process will perform the required operations to reach this state. |
@mickaelperrin could you try out nginxproxy/acme-companion:1147 ? It should reload nginx as soon as a certificate is created or renewed by default, as discussed above: diff --git a/app/letsencrypt_service b/app/letsencrypt_service
index 4f58925..0ec9e60 100755
--- a/app/letsencrypt_service
+++ b/app/letsencrypt_service
@@ -479,6 +479,9 @@ function update_cert {
fi
done
+ if ! parse_true "${RELOAD_NGINX_ONLY_ONCE:-false}" && parse_true $should_reload_nginx; then
+ reload_nginx
+ fi
}
function update_certs { |
Fix from #1166 tested and confirmed to work. |
As spotted in #1049, the way certificates are created may have performance concerns when the number of certificates to handle is very important.
The fix in #1049 handles certificates in a reverse order, but sadly this doesn't have any impact because the reload of nginx still wait that all certificates are validated even if new certificates are emitted / renewed.
Ideally:
The main challenge with this idea is to handle multiple simultaneous events, maybe some kind of queue management could help.
The text was updated successfully, but these errors were encountered: