Yesterday, I set up a Caddy server (latest via go get) and got some traffic.
I used LimitNOFILE=8192 in my systemd service description. After a while, I started seeing the following in my syslog:
Mar 21 16:33:57 cloud-1 caddy: 21/Mar/2017:15:33:57 +0000 [NOTICE 404 https://<an-url-on-my-website>] could not load error page: open <my-website>/404.html: too many open files
Caddy started serving 404 because it had run out of file descriptors.
It stopped doing that after it was restarted, but when I look at the open file descriptors:
I forgot to mention that I run Cloudflare in front of my Caddy server.
Cloudflare says that
Cloudflare maintains keep-alive connections to improve performance and reduce cost of recurring TCP connects in the request transaction as Cloudflare proxies customer traffic from its edge network to the site’s origin.
But the default timeout for Caddy should be 2 minutes, I think. I see really old file descriptors.
Anyone else having experience with Caddy + Cloudflare?
Another thing: Caddy opens the following file and writes to it:
/home/petter/wwwroot/access.log
I don’t see access.log anywhere in my Caddyfile (which is located in /home/petter/wwwroot/). Why is it written to? It gets content identical to ./log/www.log
I had this issue. I was proxying Gitea thru Caddy. It was running over https as well.
No matter ho many file descriptors I ulimit
d to the shell which spawned the caddy process, it was only a matter of hours before caddy went into a catatonic state due to too many open files.
It seems to be the proxy mech, as the Gitea process was unaffected and did not need to be restarted like Caddy was.
just FYI. I went back to just letting gitea handle all the web traffic directly.