-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
nixos-rebuild switch
spends too much time checking ACME certs
#62958
Comments
I'm almost certain this is not the case. the cert services dont depend on eachother, so they should start up in parallel. You could verify this with the output of Anyhow, I've been rewriting the acme module because it has a few bugs I ran into. Perhaps I can tackle this one too. Do you have any suggestions on how we should tackle this? I'll open a PR for that soonish. it's still all local. One of the things it does is actually remove The reason why they get started up on every switch is because |
Yes, that's the big issue. But I've just been thinking, and I have an idea how we could have our cake and eat it too. We could introduce a new set of services, e.g. test -f /path/to/cert.pem && exit 0 So this service would only call simp_le if a bootstrap is required. Then we could have I don't know if this is actually feasible, esp. wrt the |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
I have a NixOS server hosting websites on multiple domains. It provides nearly a dozen unique domains:
I noticed that
sudo nixos-rebuild switch
is taking a rather long time on that server, and went to investigate. With no changes to theconfiguration.nix
or the channels, it takes almost 20 seconds to do a no-op switch:After some further digging, it turns out that a rather large amount of time (10 seconds) is spent in this
systemctl start
invocation. In particular, what's taking a long time isThis starts every
acme-$DOMAIN.service
unit (apparently one by one, without any parallelization, if the timing is any indication). This should be no big deal because no certificates need to be renewed most of the time, but simp_le, being a Python program, just takes about a second for anything because of the whole interpreter-startup and reading-code and compiling steps.As a user, I would like
nixos-rebuild switch
to take less time to make the edit-rebuild-test loop more fluent. I can see two major venues:Since a replacement for simp_le is being considered in security.acme: simp_le -> dehydrated or certbot or acme.sh or lego #34941, I would like the replacement to be something that doesn't start an entire dynamic-language interpreter, so that
systemctl start acme-$DOMAIN.service
finishes in less than a second.From the timings that I've seen,
systemctl start acme-certificates.target
appears to be starting its constituent units serially. Can we enable some parallelization here? (Or is it already parallelizing, but without it helping the overall runtime?)Technical details
The text was updated successfully, but these errors were encountered: