You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pidfile is generated after all configured hosts are loaded. And for configurations with many hosts, this is slow. pidfile should be generated first.
The text was updated successfully, but these errors were encountered:
The pidfile should be present while the process runs.
The situation we have is that the monitoring tool thinks caddy is not running because there is no pid file and tries to restart even though caddy IS running.
Or another option would be to improve the startup time.
We have ~5k hosts in the caddy config file with a Consul backend.
Can caddy do the certs check in the background and start faster ?
@dazoot Sounds like there's a couple things going on...
I can move the PID file creation to before config load.
The long start times are because you have thousands of hosts specified in your config and, presumably, you're serving those over HTTPS, so Caddy will load and manage certs for names that appear in your config when it loads the config. That's a lot of i/o and decoding that has to take place. There's not much we can do here to speed things up except potentially use multiple cores, but that won't be an order of magnitude faster, it'll only cause delays serving requests in the meantime. The ideal way to handle lots of certificates is to enable on-demand TLS, which loads certificates at the first request that needs them, not at startup. See our wiki article for tips: https://caddy.community/t/serving-tens-of-thousands-of-domains-over-https-with-caddy/11179
The
pidfile
is generated after all configured hosts are loaded. And for configurations with many hosts, this is slow.pidfile
should be generated first.The text was updated successfully, but these errors were encountered: