On Sat, 16 Jan 2021 18:05:57 +0100, Unicorn wrote: > 2021/01/16 13:40:45 [alert] 68769#0: *1 socket() failed (24: Too many > open files) while connecting to upstream, client: 123.45.67.89, > server: cloud.mydomainhere.tld, request: "GET /core/preview?blah=1 > HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: > "cloud.mydomainhere.tld"
Error 24 is EMFILE, too many open files for the process (not the system). > I am running a Nextcloud server with NGINX and PHP 7.3. Since OpenBSD > Is quite conservative with open file limits by default, I assume that > NGINX/PHP is running into this limit. > > I have already significantly increased 'kern.maxfiles' in sysctl.conf, > but the problem persists after a reboot, leading me to believe that it > is a login.conf limit that I am running into. That would only work if you were getting error 23, ENFILE which is the system limit. > Both PHP and NGINX are running as user 'www', which does not have a > login class. Since I have not been in this situation before and > struggled to find a pointer online, I'd be thankful if you could tell > me the "recommended" or "best practice" way of doing this. The recommended way to increase a limit is to add a new login class with the same name as the daemon. For example: nginx:\ :openfiles=4096:\ :tc=daemon: This will be used automatically by the rc.d startup script. See the rc.d man page for more details. - todd